diff options
author | Abseil Team <absl-team@google.com> | 2022-03-15 20:41:41 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-03-15 20:42:11 (GMT) |
commit | b007c54f2944e193ac44fba1bc997cb65826a0b9 (patch) | |
tree | 3ea747410f93a40da0df6f8777e2ba551761cf8c /googletest/samples/sample1_unittest.cc | |
parent | 8a422b8398dd7e2b6b3e1fcbfbceb43ead2a5761 (diff) | |
download | googletest-b007c54f2944e193ac44fba1bc997cb65826a0b9.zip googletest-b007c54f2944e193ac44fba1bc997cb65826a0b9.tar.gz googletest-b007c54f2944e193ac44fba1bc997cb65826a0b9.tar.bz2 |
Running clang-format over all of GoogleTest
A few tests are examining code locations and looking af the resulting line
numbers to verify that GoogleTest shows those to users correctly. Some of those
locations change when clang-format is run. For those locations, I've wrapped
portions in:
// clang-format off
...
// clang-format on
There may be other locations that are currently not tickled by running
clang-format.
PiperOrigin-RevId: 434844712
Change-Id: I3a9f0a6f39eff741c576b6de389bef9b1d11139d
Diffstat (limited to 'googletest/samples/sample1_unittest.cc')
-rw-r--r-- | googletest/samples/sample1_unittest.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/googletest/samples/sample1_unittest.cc b/googletest/samples/sample1_unittest.cc index cb08b61..60f2770 100644 --- a/googletest/samples/sample1_unittest.cc +++ b/googletest/samples/sample1_unittest.cc @@ -34,14 +34,15 @@ // // Writing a unit test using Google C++ testing framework is easy as 1-2-3: - // Step 1. Include necessary header files such that the stuff your // test logic needs is declared. // // Don't forget gtest.h, which declares the testing framework. -#include <limits.h> #include "sample1.h" + +#include <limits.h> + #include "gtest/gtest.h" namespace { @@ -69,7 +70,6 @@ namespace { // // </TechnicalDetails> - // Tests Factorial(). // Tests factorial of negative numbers. @@ -97,9 +97,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) { @@ -109,7 +107,6 @@ TEST(FactorialTest, Positive) { EXPECT_EQ(40320, Factorial(8)); } - // Tests IsPrime() // Tests negative input. |