summaryrefslogtreecommitdiffstats
path: root/googletest/samples/sample5_unittest.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2022-03-15 20:41:41 (GMT)
committerCopybara-Service <copybara-worker@google.com>2022-03-15 20:42:11 (GMT)
commitb007c54f2944e193ac44fba1bc997cb65826a0b9 (patch)
tree3ea747410f93a40da0df6f8777e2ba551761cf8c /googletest/samples/sample5_unittest.cc
parent8a422b8398dd7e2b6b3e1fcbfbceb43ead2a5761 (diff)
downloadgoogletest-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/sample5_unittest.cc')
-rw-r--r--googletest/samples/sample5_unittest.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/googletest/samples/sample5_unittest.cc b/googletest/samples/sample5_unittest.cc
index 0a21dd2..cc8c0f0 100644
--- a/googletest/samples/sample5_unittest.cc
+++ b/googletest/samples/sample5_unittest.cc
@@ -27,7 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
// This sample teaches how to reuse a test fixture in multiple test
// cases by deriving sub-fixtures from it.
//
@@ -45,9 +44,10 @@
#include <limits.h>
#include <time.h>
-#include "gtest/gtest.h"
+
#include "sample1.h"
#include "sample3-inl.h"
+#include "gtest/gtest.h"
namespace {
// In this sample, we want to ensure that every test finishes within
// ~5 seconds. If a test takes longer to run, we consider it a
@@ -81,7 +81,6 @@ class QuickTest : public testing::Test {
time_t start_time_;
};
-
// We derive a fixture named IntegerFunctionTest from the QuickTest
// fixture. All tests using this fixture will be automatically
// required to be quick.
@@ -90,7 +89,6 @@ class IntegerFunctionTest : public QuickTest {
// Therefore the body is empty.
};
-
// Now we can write tests in the IntegerFunctionTest test case.
// Tests Factorial()
@@ -110,7 +108,6 @@ TEST_F(IntegerFunctionTest, Factorial) {
EXPECT_EQ(40320, Factorial(8));
}
-
// Tests IsPrime()
TEST_F(IntegerFunctionTest, IsPrime) {
// Tests negative input.
@@ -131,7 +128,6 @@ TEST_F(IntegerFunctionTest, IsPrime) {
EXPECT_TRUE(IsPrime(23));
}
-
// The next test case (named "QueueTest") also needs to be quick, so
// we derive another fixture from QuickTest.
//
@@ -163,13 +159,10 @@ class QueueTest : public QuickTest {
Queue<int> q2_;
};
-
// Now, let's write tests using the QueueTest fixture.
// Tests the default constructor.
-TEST_F(QueueTest, DefaultConstructor) {
- EXPECT_EQ(0u, q0_.Size());
-}
+TEST_F(QueueTest, DefaultConstructor) { EXPECT_EQ(0u, q0_.Size()); }
// Tests Dequeue().
TEST_F(QueueTest, Dequeue) {