diff options
author | Tom Hughes <tomhughes@google.com> | 2023-04-21 17:40:36 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-04-21 17:41:25 (GMT) |
commit | 783d00fd19865fcbc3065e3fb3e17144761fcf5a (patch) | |
tree | bb27246918f3fcdea0cb619a37ac43ccb1abeac0 /googlemock/test | |
parent | baf182e006bcb82ef5e0b407e350a1d4c444b76a (diff) | |
download | googletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.zip googletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.tar.gz googletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.tar.bz2 |
Use '=default' to define trivial constructor/destructorsrefs/pull/4221/head
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html
PiperOrigin-RevId: 526079054
Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
Diffstat (limited to 'googlemock/test')
-rw-r--r-- | googlemock/test/gmock-actions_test.cc | 2 | ||||
-rw-r--r-- | googlemock/test/gmock-cardinalities_test.cc | 2 | ||||
-rw-r--r-- | googlemock/test/gmock-function-mocker_test.cc | 24 | ||||
-rw-r--r-- | googlemock/test/gmock-matchers-arithmetic_test.cc | 4 | ||||
-rw-r--r-- | googlemock/test/gmock-matchers-comparisons_test.cc | 4 | ||||
-rw-r--r-- | googlemock/test/gmock-matchers-containers_test.cc | 2 | ||||
-rw-r--r-- | googlemock/test/gmock-nice-strict_test.cc | 8 | ||||
-rw-r--r-- | googlemock/test/gmock-spec-builders_test.cc | 14 | ||||
-rw-r--r-- | googlemock/test/gmock_leak_test_.cc | 4 | ||||
-rw-r--r-- | googlemock/test/gmock_link_test.h | 4 | ||||
-rw-r--r-- | googlemock/test/gmock_output_test_.cc | 2 |
11 files changed, 35 insertions, 35 deletions
diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc index f2305e5..f569e83 100644 --- a/googlemock/test/gmock-actions_test.cc +++ b/googlemock/test/gmock-actions_test.cc @@ -985,7 +985,7 @@ TEST(ReturnRoundRobinTest, WorksForVector) { class MockClass { public: - MockClass() {} + MockClass() = default; MOCK_METHOD1(IntFunc, int(bool flag)); // NOLINT MOCK_METHOD0(Foo, MyNonDefaultConstructible()); diff --git a/googlemock/test/gmock-cardinalities_test.cc b/googlemock/test/gmock-cardinalities_test.cc index 77196d7..ad49752 100644 --- a/googlemock/test/gmock-cardinalities_test.cc +++ b/googlemock/test/gmock-cardinalities_test.cc @@ -52,7 +52,7 @@ using testing::MakeCardinality; class MockFoo { public: - MockFoo() {} + MockFoo() = default; MOCK_METHOD0(Bar, int()); // NOLINT private: diff --git a/googlemock/test/gmock-function-mocker_test.cc b/googlemock/test/gmock-function-mocker_test.cc index 4db498d..f7b31ae 100644 --- a/googlemock/test/gmock-function-mocker_test.cc +++ b/googlemock/test/gmock-function-mocker_test.cc @@ -70,7 +70,7 @@ using testing::TypedEq; template <typename T> class TemplatedCopyable { public: - TemplatedCopyable() {} + TemplatedCopyable() = default; template <typename U> TemplatedCopyable(const U& other) {} // NOLINT @@ -78,7 +78,7 @@ class TemplatedCopyable { class FooInterface { public: - virtual ~FooInterface() {} + virtual ~FooInterface() = default; virtual void VoidReturning(int x) = 0; @@ -137,7 +137,7 @@ class FooInterface { GTEST_DISABLE_MSC_WARNINGS_PUSH_(4373) class MockFoo : public FooInterface { public: - MockFoo() {} + MockFoo() = default; // Makes sure that a mock function parameter can be named. MOCK_METHOD(void, VoidReturning, (int n)); // NOLINT @@ -208,7 +208,7 @@ class MockFoo : public FooInterface { class LegacyMockFoo : public FooInterface { public: - LegacyMockFoo() {} + LegacyMockFoo() = default; // Makes sure that a mock function parameter can be named. MOCK_METHOD1(VoidReturning, void(int n)); // NOLINT @@ -487,7 +487,7 @@ TEST(FunctionMockerTest, RefQualified) { class MockB { public: - MockB() {} + MockB() = default; MOCK_METHOD(void, DoB, ()); @@ -498,7 +498,7 @@ class MockB { class LegacyMockB { public: - LegacyMockB() {} + LegacyMockB() = default; MOCK_METHOD0(DoB, void()); @@ -534,7 +534,7 @@ TYPED_TEST(ExpectCallTest, UnmentionedFunctionCanBeCalledAnyNumberOfTimes) { template <typename T> class StackInterface { public: - virtual ~StackInterface() {} + virtual ~StackInterface() = default; // Template parameter appears in function parameter. virtual void Push(const T& value) = 0; @@ -547,7 +547,7 @@ class StackInterface { template <typename T> class MockStack : public StackInterface<T> { public: - MockStack() {} + MockStack() = default; MOCK_METHOD(void, Push, (const T& elem), ()); MOCK_METHOD(void, Pop, (), (final)); @@ -566,7 +566,7 @@ class MockStack : public StackInterface<T> { template <typename T> class LegacyMockStack : public StackInterface<T> { public: - LegacyMockStack() {} + LegacyMockStack() = default; MOCK_METHOD1_T(Push, void(const T& elem)); MOCK_METHOD0_T(Pop, void()); @@ -711,7 +711,7 @@ TYPED_TEST(TemplateMockTestWithCallType, Works) { class MockOverloadedOnArgNumber { public: - MockOverloadedOnArgNumber() {} + MockOverloadedOnArgNumber() = default; MY_MOCK_METHODS1_; @@ -723,7 +723,7 @@ class MockOverloadedOnArgNumber { class LegacyMockOverloadedOnArgNumber { public: - LegacyMockOverloadedOnArgNumber() {} + LegacyMockOverloadedOnArgNumber() = default; LEGACY_MY_MOCK_METHODS1_; @@ -758,7 +758,7 @@ TYPED_TEST(OverloadedMockMethodTest, CanOverloadOnArgNumberInMacroBody) { class MockOverloadedOnConstness { public: - MockOverloadedOnConstness() {} + MockOverloadedOnConstness() = default; MY_MOCK_METHODS2_; diff --git a/googlemock/test/gmock-matchers-arithmetic_test.cc b/googlemock/test/gmock-matchers-arithmetic_test.cc index 062e2ab..f176962 100644 --- a/googlemock/test/gmock-matchers-arithmetic_test.cc +++ b/googlemock/test/gmock-matchers-arithmetic_test.cc @@ -955,7 +955,7 @@ TEST(AllArgsTest, WorksForNonTuple) { class AllArgsHelper { public: - AllArgsHelper() {} + AllArgsHelper() = default; MOCK_METHOD2(Helper, int(char x, int y)); @@ -976,7 +976,7 @@ TEST(AllArgsTest, WorksInWithClause) { class OptionalMatchersHelper { public: - OptionalMatchersHelper() {} + OptionalMatchersHelper() = default; MOCK_METHOD0(NoArgs, int()); diff --git a/googlemock/test/gmock-matchers-comparisons_test.cc b/googlemock/test/gmock-matchers-comparisons_test.cc index cf85eb5..b2ce99e 100644 --- a/googlemock/test/gmock-matchers-comparisons_test.cc +++ b/googlemock/test/gmock-matchers-comparisons_test.cc @@ -589,8 +589,8 @@ TEST(MatcherCastTest, ValueIsNotCopied) { class Base { public: - virtual ~Base() {} - Base() {} + virtual ~Base() = default; + Base() = default; private: Base(const Base&) = delete; diff --git a/googlemock/test/gmock-matchers-containers_test.cc b/googlemock/test/gmock-matchers-containers_test.cc index 654a011..38fd9a5 100644 --- a/googlemock/test/gmock-matchers-containers_test.cc +++ b/googlemock/test/gmock-matchers-containers_test.cc @@ -2788,7 +2788,7 @@ TEST(ElementsAreTest, WorksWithNativeArrayPassedByReference) { class NativeArrayPassedAsPointerAndSize { public: - NativeArrayPassedAsPointerAndSize() {} + NativeArrayPassedAsPointerAndSize() = default; MOCK_METHOD(void, Helper, (int* array, int size)); diff --git a/googlemock/test/gmock-nice-strict_test.cc b/googlemock/test/gmock-nice-strict_test.cc index 08254e1..95f0969 100644 --- a/googlemock/test/gmock-nice-strict_test.cc +++ b/googlemock/test/gmock-nice-strict_test.cc @@ -40,7 +40,7 @@ // clash with ::testing::Mock. class Mock { public: - Mock() {} + Mock() = default; MOCK_METHOD0(DoThis, void()); @@ -78,7 +78,7 @@ class CallsMockMethodInDestructor { class Foo { public: - virtual ~Foo() {} + virtual ~Foo() = default; virtual void DoThis() = 0; virtual int DoThat(bool flag) = 0; @@ -86,7 +86,7 @@ class Foo { class MockFoo : public Foo { public: - MockFoo() {} + MockFoo() = default; void Delete() { delete this; } MOCK_METHOD0(DoThis, void()); @@ -109,7 +109,7 @@ class MockBar { (a10 ? 'T' : 'F'); } - virtual ~MockBar() {} + virtual ~MockBar() = default; const std::string& str() const { return str_; } diff --git a/googlemock/test/gmock-spec-builders_test.cc b/googlemock/test/gmock-spec-builders_test.cc index d53196b..7ba591a 100644 --- a/googlemock/test/gmock-spec-builders_test.cc +++ b/googlemock/test/gmock-spec-builders_test.cc @@ -98,7 +98,7 @@ class NonDefaultConstructible { class MockA { public: - MockA() {} + MockA() = default; MOCK_METHOD1(DoA, void(int n)); MOCK_METHOD1(ReturnResult, Result(int n)); @@ -113,7 +113,7 @@ class MockA { class MockB { public: - MockB() {} + MockB() = default; MOCK_CONST_METHOD0(DoB, int()); // NOLINT MOCK_METHOD1(DoB, int(int n)); // NOLINT @@ -125,7 +125,7 @@ class MockB { class ReferenceHoldingMock { public: - ReferenceHoldingMock() {} + ReferenceHoldingMock() = default; MOCK_METHOD1(AcceptReference, void(std::shared_ptr<MockA>*)); @@ -143,12 +143,12 @@ class ReferenceHoldingMock { class CC { public: - virtual ~CC() {} + virtual ~CC() = default; virtual int Method() = 0; }; class MockCC : public CC { public: - MockCC() {} + MockCC() = default; MOCK_METHOD0(Method, int()); @@ -1881,7 +1881,7 @@ struct Unprintable { class MockC { public: - MockC() {} + MockC() = default; MOCK_METHOD6(VoidMethod, void(bool cond, int n, std::string s, void* p, const Printable& x, Unprintable y)); @@ -2121,7 +2121,7 @@ void PrintTo(PrintMeNot /* dummy */, ::std::ostream* /* os */) { class LogTestHelper { public: - LogTestHelper() {} + LogTestHelper() = default; MOCK_METHOD1(Foo, PrintMeNot(PrintMeNot)); diff --git a/googlemock/test/gmock_leak_test_.cc b/googlemock/test/gmock_leak_test_.cc index fa64591..a6bb339 100644 --- a/googlemock/test/gmock_leak_test_.cc +++ b/googlemock/test/gmock_leak_test_.cc @@ -40,13 +40,13 @@ using ::testing::Return; class FooInterface { public: - virtual ~FooInterface() {} + virtual ~FooInterface() = default; virtual void DoThis() = 0; }; class MockFoo : public FooInterface { public: - MockFoo() {} + MockFoo() = default; MOCK_METHOD0(DoThis, void()); diff --git a/googlemock/test/gmock_link_test.h b/googlemock/test/gmock_link_test.h index 8d2abb1..db11c2d 100644 --- a/googlemock/test/gmock_link_test.h +++ b/googlemock/test/gmock_link_test.h @@ -194,7 +194,7 @@ using testing::MatchesRegex; class Interface { public: - virtual ~Interface() {} + virtual ~Interface() = default; virtual void VoidFromString(char* str) = 0; virtual char* StringFromString(char* str) = 0; virtual int IntFromString(char* str) = 0; @@ -208,7 +208,7 @@ class Interface { class Mock : public Interface { public: - Mock() {} + Mock() = default; MOCK_METHOD1(VoidFromString, void(char* str)); MOCK_METHOD1(StringFromString, char*(char* str)); diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index ca5a646..04a6e8b 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -53,7 +53,7 @@ using testing::Value; class MockFoo { public: - MockFoo() {} + MockFoo() = default; MOCK_METHOD3(Bar, char(const std::string& s, int i, double x)); MOCK_METHOD2(Bar2, bool(int x, int y)); |