Commit c7c7961d authored by vladlosev's avatar vladlosev
Browse files

Simplifies test assertions in sample5.

parent 431a8be1
......@@ -117,20 +117,20 @@ TEST_F(IntegerFunctionTest, Factorial) {
// Tests IsPrime()
TEST_F(IntegerFunctionTest, IsPrime) {
// Tests negative input.
EXPECT_TRUE(!IsPrime(-1));
EXPECT_TRUE(!IsPrime(-2));
EXPECT_TRUE(!IsPrime(INT_MIN));
EXPECT_FALSE(IsPrime(-1));
EXPECT_FALSE(IsPrime(-2));
EXPECT_FALSE(IsPrime(INT_MIN));
// Tests some trivial cases.
EXPECT_TRUE(!IsPrime(0));
EXPECT_TRUE(!IsPrime(1));
EXPECT_FALSE(IsPrime(0));
EXPECT_FALSE(IsPrime(1));
EXPECT_TRUE(IsPrime(2));
EXPECT_TRUE(IsPrime(3));
// Tests positive input.
EXPECT_TRUE(!IsPrime(4));
EXPECT_FALSE(IsPrime(4));
EXPECT_TRUE(IsPrime(5));
EXPECT_TRUE(!IsPrime(6));
EXPECT_FALSE(IsPrime(6));
EXPECT_TRUE(IsPrime(23));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment