Simplifies test assertions in sample5.

This commit is contained in:
vladlosev 2011-10-14 01:18:53 +00:00
parent 431a8be166
commit c7c7961d23

View File

@ -117,20 +117,20 @@ TEST_F(IntegerFunctionTest, Factorial) {
// Tests IsPrime() // Tests IsPrime()
TEST_F(IntegerFunctionTest, IsPrime) { TEST_F(IntegerFunctionTest, IsPrime) {
// Tests negative input. // Tests negative input.
EXPECT_TRUE(!IsPrime(-1)); EXPECT_FALSE(IsPrime(-1));
EXPECT_TRUE(!IsPrime(-2)); EXPECT_FALSE(IsPrime(-2));
EXPECT_TRUE(!IsPrime(INT_MIN)); EXPECT_FALSE(IsPrime(INT_MIN));
// Tests some trivial cases. // Tests some trivial cases.
EXPECT_TRUE(!IsPrime(0)); EXPECT_FALSE(IsPrime(0));
EXPECT_TRUE(!IsPrime(1)); EXPECT_FALSE(IsPrime(1));
EXPECT_TRUE(IsPrime(2)); EXPECT_TRUE(IsPrime(2));
EXPECT_TRUE(IsPrime(3)); EXPECT_TRUE(IsPrime(3));
// Tests positive input. // Tests positive input.
EXPECT_TRUE(!IsPrime(4)); EXPECT_FALSE(IsPrime(4));
EXPECT_TRUE(IsPrime(5)); EXPECT_TRUE(IsPrime(5));
EXPECT_TRUE(!IsPrime(6)); EXPECT_FALSE(IsPrime(6));
EXPECT_TRUE(IsPrime(23)); EXPECT_TRUE(IsPrime(23));
} }