Commit b007c54f authored by Abseil Team's avatar Abseil Team Committed by Copybara-Service
Browse files

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
parent 8a422b83
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest-spi.h" #include "gtest/gtest-spi.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
...@@ -102,7 +103,8 @@ class MockBar { ...@@ -102,7 +103,8 @@ class MockBar {
MockBar(char a1, char a2, std::string a3, std::string a4, int a5, int a6, MockBar(char a1, char a2, std::string a3, std::string a4, int a5, int a6,
const std::string& a7, const std::string& a8, bool a9, bool a10) { const std::string& a7, const std::string& a8, bool a9, bool a10) {
str_ = std::string() + a1 + a2 + a3 + a4 + static_cast<char>(a5) + str_ = std::string() + a1 + a2 + a3 + a4 + static_cast<char>(a5) +
static_cast<char>(a6) + a7 + a8 + (a9 ? 'T' : 'F') + (a10 ? 'T' : 'F'); static_cast<char>(a6) + a7 + a8 + (a9 ? 'T' : 'F') +
(a10 ? 'T' : 'F');
} }
virtual ~MockBar() {} virtual ~MockBar() {}
...@@ -118,7 +120,6 @@ class MockBar { ...@@ -118,7 +120,6 @@ class MockBar {
GTEST_DISALLOW_COPY_AND_ASSIGN_(MockBar); GTEST_DISALLOW_COPY_AND_ASSIGN_(MockBar);
}; };
class MockBaz { class MockBaz {
public: public:
class MoveOnly { class MoveOnly {
...@@ -161,8 +162,7 @@ TEST(RawMockTest, WarningForUninterestingCallAfterDeath) { ...@@ -161,8 +162,7 @@ TEST(RawMockTest, WarningForUninterestingCallAfterDeath) {
MockFoo* const raw_foo = new MockFoo; MockFoo* const raw_foo = new MockFoo;
ON_CALL(*raw_foo, DoThis()) ON_CALL(*raw_foo, DoThis()).WillByDefault(Invoke(raw_foo, &MockFoo::Delete));
.WillByDefault(Invoke(raw_foo, &MockFoo::Delete));
CaptureStdout(); CaptureStdout();
raw_foo->DoThis(); raw_foo->DoThis();
...@@ -280,8 +280,8 @@ TEST(NiceMockTest, NonDefaultConstructor) { ...@@ -280,8 +280,8 @@ TEST(NiceMockTest, NonDefaultConstructor) {
// Tests that NiceMock works with a mock class that has a 10-ary // Tests that NiceMock works with a mock class that has a 10-ary
// non-default constructor. // non-default constructor.
TEST(NiceMockTest, NonDefaultConstructor10) { TEST(NiceMockTest, NonDefaultConstructor10) {
NiceMock<MockBar> nice_bar('a', 'b', "c", "d", 'e', 'f', NiceMock<MockBar> nice_bar('a', 'b', "c", "d", 'e', 'f', "g", "h", true,
"g", "h", true, false); false);
EXPECT_EQ("abcdefghTF", nice_bar.str()); EXPECT_EQ("abcdefghTF", nice_bar.str());
nice_bar.This(); nice_bar.This();
...@@ -390,8 +390,8 @@ TEST(NaggyMockTest, NonDefaultConstructor) { ...@@ -390,8 +390,8 @@ TEST(NaggyMockTest, NonDefaultConstructor) {
// Tests that NaggyMock works with a mock class that has a 10-ary // Tests that NaggyMock works with a mock class that has a 10-ary
// non-default constructor. // non-default constructor.
TEST(NaggyMockTest, NonDefaultConstructor10) { TEST(NaggyMockTest, NonDefaultConstructor10) {
NaggyMock<MockBar> naggy_bar('0', '1', "2", "3", '4', '5', NaggyMock<MockBar> naggy_bar('0', '1', "2", "3", '4', '5', "6", "7", true,
"6", "7", true, false); false);
EXPECT_EQ("01234567TF", naggy_bar.str()); EXPECT_EQ("01234567TF", naggy_bar.str());
naggy_bar.This(); naggy_bar.This();
...@@ -490,8 +490,8 @@ TEST(StrictMockTest, NonDefaultConstructor) { ...@@ -490,8 +490,8 @@ TEST(StrictMockTest, NonDefaultConstructor) {
// Tests that StrictMock works with a mock class that has a 10-ary // Tests that StrictMock works with a mock class that has a 10-ary
// non-default constructor. // non-default constructor.
TEST(StrictMockTest, NonDefaultConstructor10) { TEST(StrictMockTest, NonDefaultConstructor10) {
StrictMock<MockBar> strict_bar('a', 'b', "c", "d", 'e', 'f', StrictMock<MockBar> strict_bar('a', 'b', "c", "d", 'e', 'f', "g", "h", true,
"g", "h", true, false); false);
EXPECT_EQ("abcdefghTF", strict_bar.str()); EXPECT_EQ("abcdefghTF", strict_bar.str());
EXPECT_NONFATAL_FAILURE(strict_bar.That(5, true), EXPECT_NONFATAL_FAILURE(strict_bar.That(5, true),
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment