summaryrefslogtreecommitdiffstats
path: root/googletest/samples/sample1_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/samples/sample1_unittest.cc')
-rw-r--r--googletest/samples/sample1_unittest.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/googletest/samples/sample1_unittest.cc b/googletest/samples/sample1_unittest.cc
index aefc4f1..861eff9 100644
--- a/googletest/samples/sample1_unittest.cc
+++ b/googletest/samples/sample1_unittest.cc
@@ -46,7 +46,7 @@
#include <limits.h>
#include "sample1.h"
#include "gtest/gtest.h"
-
+namespace {
// Step 2. Use the TEST macro to define your tests.
//
@@ -72,7 +72,6 @@
//
// </TechnicalDetails>
-
// Tests Factorial().
// Tests factorial of negative numbers.
@@ -100,9 +99,7 @@ TEST(FactorialTest, Negative) {
}
// Tests factorial of 0.
-TEST(FactorialTest, Zero) {
- EXPECT_EQ(1, Factorial(0));
-}
+TEST(FactorialTest, Zero) { EXPECT_EQ(1, Factorial(0)); }
// Tests factorial of positive numbers.
TEST(FactorialTest, Positive) {
@@ -112,7 +109,6 @@ TEST(FactorialTest, Positive) {
EXPECT_EQ(40320, Factorial(8));
}
-
// Tests IsPrime()
// Tests negative input.
@@ -139,6 +135,7 @@ TEST(IsPrimeTest, Positive) {
EXPECT_FALSE(IsPrime(6));
EXPECT_TRUE(IsPrime(23));
}
+} // namespace
// Step 3. Call RUN_ALL_TESTS() in main().
//