Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
c7c7961d
Commit
c7c7961d
authored
Oct 14, 2011
by
vladlosev
Browse files
Simplifies test assertions in sample5.
parent
431a8be1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
samples/sample5_unittest.cc
samples/sample5_unittest.cc
+7
-7
No files found.
samples/sample5_unittest.cc
View file @
c7c7961d
...
@@ -117,20 +117,20 @@ TEST_F(IntegerFunctionTest, Factorial) {
...
@@ -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_
TRU
E
(
!
IsPrime
(
-
1
));
EXPECT_
FALS
E
(
IsPrime
(
-
1
));
EXPECT_
TRU
E
(
!
IsPrime
(
-
2
));
EXPECT_
FALS
E
(
IsPrime
(
-
2
));
EXPECT_
TRU
E
(
!
IsPrime
(
INT_MIN
));
EXPECT_
FALS
E
(
IsPrime
(
INT_MIN
));
// Tests some trivial cases.
// Tests some trivial cases.
EXPECT_
TRU
E
(
!
IsPrime
(
0
));
EXPECT_
FALS
E
(
IsPrime
(
0
));
EXPECT_
TRU
E
(
!
IsPrime
(
1
));
EXPECT_
FALS
E
(
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_
TRU
E
(
!
IsPrime
(
4
));
EXPECT_
FALS
E
(
IsPrime
(
4
));
EXPECT_TRUE
(
IsPrime
(
5
));
EXPECT_TRUE
(
IsPrime
(
5
));
EXPECT_
TRU
E
(
!
IsPrime
(
6
));
EXPECT_
FALS
E
(
IsPrime
(
6
));
EXPECT_TRUE
(
IsPrime
(
23
));
EXPECT_TRUE
(
IsPrime
(
23
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment