Commit 783d00fd authored by Tom Hughes's avatar Tom Hughes Committed by Copybara-Service
Browse files

Use '=default' to define trivial constructor/destructors

https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html

PiperOrigin-RevId: 526079054
Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
parent baf182e0
...@@ -611,7 +611,7 @@ class DefaultValue { ...@@ -611,7 +611,7 @@ class DefaultValue {
private: private:
class ValueProducer { class ValueProducer {
public: public:
virtual ~ValueProducer() {} virtual ~ValueProducer() = default;
virtual T Produce() = 0; virtual T Produce() = 0;
}; };
...@@ -699,8 +699,8 @@ class ActionInterface { ...@@ -699,8 +699,8 @@ class ActionInterface {
typedef typename internal::Function<F>::Result Result; typedef typename internal::Function<F>::Result Result;
typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
ActionInterface() {} ActionInterface() = default;
virtual ~ActionInterface() {} virtual ~ActionInterface() = default;
// Performs the action. This method is not const, as in general an // Performs the action. This method is not const, as in general an
// action can have side effects and be stateful. For example, a // action can have side effects and be stateful. For example, a
...@@ -749,7 +749,7 @@ class Action<R(Args...)> { ...@@ -749,7 +749,7 @@ class Action<R(Args...)> {
// Constructs a null Action. Needed for storing Action objects in // Constructs a null Action. Needed for storing Action objects in
// STL containers. // STL containers.
Action() {} Action() = default;
// Construct an Action from a specified callable. // Construct an Action from a specified callable.
// This cannot take std::function directly, because then Action would not be // This cannot take std::function directly, because then Action would not be
......
...@@ -65,7 +65,7 @@ namespace testing { ...@@ -65,7 +65,7 @@ namespace testing {
// The implementation of a cardinality. // The implementation of a cardinality.
class CardinalityInterface { class CardinalityInterface {
public: public:
virtual ~CardinalityInterface() {} virtual ~CardinalityInterface() = default;
// Conservative estimate on the lower/upper bound of the number of // Conservative estimate on the lower/upper bound of the number of
// calls allowed. // calls allowed.
...@@ -92,7 +92,7 @@ class GTEST_API_ Cardinality { ...@@ -92,7 +92,7 @@ class GTEST_API_ Cardinality {
public: public:
// Constructs a null cardinality. Needed for storing Cardinality // Constructs a null cardinality. Needed for storing Cardinality
// objects in STL containers. // objects in STL containers.
Cardinality() {} Cardinality() = default;
// Constructs a Cardinality from its implementation. // Constructs a Cardinality from its implementation.
explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {} explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}
......
...@@ -566,7 +566,7 @@ class ExpectationSet { ...@@ -566,7 +566,7 @@ class ExpectationSet {
typedef Expectation::Set::value_type value_type; typedef Expectation::Set::value_type value_type;
// Constructs an empty set. // Constructs an empty set.
ExpectationSet() {} ExpectationSet() = default;
// This single-argument ctor must not be explicit, in order to support the // This single-argument ctor must not be explicit, in order to support the
// ExpectationSet es = EXPECT_CALL(...); // ExpectationSet es = EXPECT_CALL(...);
...@@ -1446,7 +1446,7 @@ class FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase { ...@@ -1446,7 +1446,7 @@ class FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase {
using ArgumentTuple = std::tuple<Args...>; using ArgumentTuple = std::tuple<Args...>;
using ArgumentMatcherTuple = std::tuple<Matcher<Args>...>; using ArgumentMatcherTuple = std::tuple<Matcher<Args>...>;
FunctionMocker() {} FunctionMocker() = default;
// There is no generally useful and implementable semantics of // There is no generally useful and implementable semantics of
// copying a mock object, so copying a mock is usually a user error. // copying a mock object, so copying a mock is usually a user error.
......
...@@ -224,7 +224,7 @@ class FailureReporterInterface { ...@@ -224,7 +224,7 @@ class FailureReporterInterface {
// The type of a failure (either non-fatal or fatal). // The type of a failure (either non-fatal or fatal).
enum FailureType { kNonfatal, kFatal }; enum FailureType { kNonfatal, kFatal };
virtual ~FailureReporterInterface() {} virtual ~FailureReporterInterface() = default;
// Reports a failure that occurred at the given source file location. // Reports a failure that occurred at the given source file location.
virtual void ReportFailure(FailureType type, const char* file, int line, virtual void ReportFailure(FailureType type, const char* file, int line,
......
...@@ -96,7 +96,7 @@ ExpectationBase::ExpectationBase(const char* a_file, int a_line, ...@@ -96,7 +96,7 @@ ExpectationBase::ExpectationBase(const char* a_file, int a_line,
action_count_checked_(false) {} action_count_checked_(false) {}
// Destructs an ExpectationBase object. // Destructs an ExpectationBase object.
ExpectationBase::~ExpectationBase() {} ExpectationBase::~ExpectationBase() = default;
// Explicitly specifies the cardinality of this expectation. Used by // Explicitly specifies the cardinality of this expectation. Used by
// the subclasses to implement the .Times() clause. // the subclasses to implement the .Times() clause.
...@@ -309,7 +309,7 @@ void ReportUninterestingCall(CallReaction reaction, const std::string& msg) { ...@@ -309,7 +309,7 @@ void ReportUninterestingCall(CallReaction reaction, const std::string& msg) {
UntypedFunctionMockerBase::UntypedFunctionMockerBase() UntypedFunctionMockerBase::UntypedFunctionMockerBase()
: mock_obj_(nullptr), name_("") {} : mock_obj_(nullptr), name_("") {}
UntypedFunctionMockerBase::~UntypedFunctionMockerBase() {} UntypedFunctionMockerBase::~UntypedFunctionMockerBase() = default;
// Sets the mock object this mock method belongs to, and registers // Sets the mock object this mock method belongs to, and registers
// this information in the global mock registry. Will be called // this information in the global mock registry. Will be called
...@@ -746,13 +746,13 @@ void Mock::ClearDefaultActionsLocked(void* mock_obj) ...@@ -746,13 +746,13 @@ void Mock::ClearDefaultActionsLocked(void* mock_obj)
// needed by VerifyAndClearExpectationsLocked(). // needed by VerifyAndClearExpectationsLocked().
} }
Expectation::Expectation() {} Expectation::Expectation() = default;
Expectation::Expectation( Expectation::Expectation(
const std::shared_ptr<internal::ExpectationBase>& an_expectation_base) const std::shared_ptr<internal::ExpectationBase>& an_expectation_base)
: expectation_base_(an_expectation_base) {} : expectation_base_(an_expectation_base) {}
Expectation::~Expectation() {} Expectation::~Expectation() = default;
// Adds an expectation to a sequence. // Adds an expectation to a sequence.
void Sequence::AddExpectation(const Expectation& expectation) const { void Sequence::AddExpectation(const Expectation& expectation) const {
......
...@@ -985,7 +985,7 @@ TEST(ReturnRoundRobinTest, WorksForVector) { ...@@ -985,7 +985,7 @@ TEST(ReturnRoundRobinTest, WorksForVector) {
class MockClass { class MockClass {
public: public:
MockClass() {} MockClass() = default;
MOCK_METHOD1(IntFunc, int(bool flag)); // NOLINT MOCK_METHOD1(IntFunc, int(bool flag)); // NOLINT
MOCK_METHOD0(Foo, MyNonDefaultConstructible()); MOCK_METHOD0(Foo, MyNonDefaultConstructible());
......
...@@ -52,7 +52,7 @@ using testing::MakeCardinality; ...@@ -52,7 +52,7 @@ using testing::MakeCardinality;
class MockFoo { class MockFoo {
public: public:
MockFoo() {} MockFoo() = default;
MOCK_METHOD0(Bar, int()); // NOLINT MOCK_METHOD0(Bar, int()); // NOLINT
private: private:
......
...@@ -70,7 +70,7 @@ using testing::TypedEq; ...@@ -70,7 +70,7 @@ using testing::TypedEq;
template <typename T> template <typename T>
class TemplatedCopyable { class TemplatedCopyable {
public: public:
TemplatedCopyable() {} TemplatedCopyable() = default;
template <typename U> template <typename U>
TemplatedCopyable(const U& other) {} // NOLINT TemplatedCopyable(const U& other) {} // NOLINT
...@@ -78,7 +78,7 @@ class TemplatedCopyable { ...@@ -78,7 +78,7 @@ class TemplatedCopyable {
class FooInterface { class FooInterface {
public: public:
virtual ~FooInterface() {} virtual ~FooInterface() = default;
virtual void VoidReturning(int x) = 0; virtual void VoidReturning(int x) = 0;
...@@ -137,7 +137,7 @@ class FooInterface { ...@@ -137,7 +137,7 @@ class FooInterface {
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4373) GTEST_DISABLE_MSC_WARNINGS_PUSH_(4373)
class MockFoo : public FooInterface { class MockFoo : public FooInterface {
public: public:
MockFoo() {} MockFoo() = default;
// Makes sure that a mock function parameter can be named. // Makes sure that a mock function parameter can be named.
MOCK_METHOD(void, VoidReturning, (int n)); // NOLINT MOCK_METHOD(void, VoidReturning, (int n)); // NOLINT
...@@ -208,7 +208,7 @@ class MockFoo : public FooInterface { ...@@ -208,7 +208,7 @@ class MockFoo : public FooInterface {
class LegacyMockFoo : public FooInterface { class LegacyMockFoo : public FooInterface {
public: public:
LegacyMockFoo() {} LegacyMockFoo() = default;
// Makes sure that a mock function parameter can be named. // Makes sure that a mock function parameter can be named.
MOCK_METHOD1(VoidReturning, void(int n)); // NOLINT MOCK_METHOD1(VoidReturning, void(int n)); // NOLINT
...@@ -487,7 +487,7 @@ TEST(FunctionMockerTest, RefQualified) { ...@@ -487,7 +487,7 @@ TEST(FunctionMockerTest, RefQualified) {
class MockB { class MockB {
public: public:
MockB() {} MockB() = default;
MOCK_METHOD(void, DoB, ()); MOCK_METHOD(void, DoB, ());
...@@ -498,7 +498,7 @@ class MockB { ...@@ -498,7 +498,7 @@ class MockB {
class LegacyMockB { class LegacyMockB {
public: public:
LegacyMockB() {} LegacyMockB() = default;
MOCK_METHOD0(DoB, void()); MOCK_METHOD0(DoB, void());
...@@ -534,7 +534,7 @@ TYPED_TEST(ExpectCallTest, UnmentionedFunctionCanBeCalledAnyNumberOfTimes) { ...@@ -534,7 +534,7 @@ TYPED_TEST(ExpectCallTest, UnmentionedFunctionCanBeCalledAnyNumberOfTimes) {
template <typename T> template <typename T>
class StackInterface { class StackInterface {
public: public:
virtual ~StackInterface() {} virtual ~StackInterface() = default;
// Template parameter appears in function parameter. // Template parameter appears in function parameter.
virtual void Push(const T& value) = 0; virtual void Push(const T& value) = 0;
...@@ -547,7 +547,7 @@ class StackInterface { ...@@ -547,7 +547,7 @@ class StackInterface {
template <typename T> template <typename T>
class MockStack : public StackInterface<T> { class MockStack : public StackInterface<T> {
public: public:
MockStack() {} MockStack() = default;
MOCK_METHOD(void, Push, (const T& elem), ()); MOCK_METHOD(void, Push, (const T& elem), ());
MOCK_METHOD(void, Pop, (), (final)); MOCK_METHOD(void, Pop, (), (final));
...@@ -566,7 +566,7 @@ class MockStack : public StackInterface<T> { ...@@ -566,7 +566,7 @@ class MockStack : public StackInterface<T> {
template <typename T> template <typename T>
class LegacyMockStack : public StackInterface<T> { class LegacyMockStack : public StackInterface<T> {
public: public:
LegacyMockStack() {} LegacyMockStack() = default;
MOCK_METHOD1_T(Push, void(const T& elem)); MOCK_METHOD1_T(Push, void(const T& elem));
MOCK_METHOD0_T(Pop, void()); MOCK_METHOD0_T(Pop, void());
...@@ -711,7 +711,7 @@ TYPED_TEST(TemplateMockTestWithCallType, Works) { ...@@ -711,7 +711,7 @@ TYPED_TEST(TemplateMockTestWithCallType, Works) {
class MockOverloadedOnArgNumber { class MockOverloadedOnArgNumber {
public: public:
MockOverloadedOnArgNumber() {} MockOverloadedOnArgNumber() = default;
MY_MOCK_METHODS1_; MY_MOCK_METHODS1_;
...@@ -723,7 +723,7 @@ class MockOverloadedOnArgNumber { ...@@ -723,7 +723,7 @@ class MockOverloadedOnArgNumber {
class LegacyMockOverloadedOnArgNumber { class LegacyMockOverloadedOnArgNumber {
public: public:
LegacyMockOverloadedOnArgNumber() {} LegacyMockOverloadedOnArgNumber() = default;
LEGACY_MY_MOCK_METHODS1_; LEGACY_MY_MOCK_METHODS1_;
...@@ -758,7 +758,7 @@ TYPED_TEST(OverloadedMockMethodTest, CanOverloadOnArgNumberInMacroBody) { ...@@ -758,7 +758,7 @@ TYPED_TEST(OverloadedMockMethodTest, CanOverloadOnArgNumberInMacroBody) {
class MockOverloadedOnConstness { class MockOverloadedOnConstness {
public: public:
MockOverloadedOnConstness() {} MockOverloadedOnConstness() = default;
MY_MOCK_METHODS2_; MY_MOCK_METHODS2_;
......
...@@ -955,7 +955,7 @@ TEST(AllArgsTest, WorksForNonTuple) { ...@@ -955,7 +955,7 @@ TEST(AllArgsTest, WorksForNonTuple) {
class AllArgsHelper { class AllArgsHelper {
public: public:
AllArgsHelper() {} AllArgsHelper() = default;
MOCK_METHOD2(Helper, int(char x, int y)); MOCK_METHOD2(Helper, int(char x, int y));
...@@ -976,7 +976,7 @@ TEST(AllArgsTest, WorksInWithClause) { ...@@ -976,7 +976,7 @@ TEST(AllArgsTest, WorksInWithClause) {
class OptionalMatchersHelper { class OptionalMatchersHelper {
public: public:
OptionalMatchersHelper() {} OptionalMatchersHelper() = default;
MOCK_METHOD0(NoArgs, int()); MOCK_METHOD0(NoArgs, int());
......
...@@ -589,8 +589,8 @@ TEST(MatcherCastTest, ValueIsNotCopied) { ...@@ -589,8 +589,8 @@ TEST(MatcherCastTest, ValueIsNotCopied) {
class Base { class Base {
public: public:
virtual ~Base() {} virtual ~Base() = default;
Base() {} Base() = default;
private: private:
Base(const Base&) = delete; Base(const Base&) = delete;
......
...@@ -2788,7 +2788,7 @@ TEST(ElementsAreTest, WorksWithNativeArrayPassedByReference) { ...@@ -2788,7 +2788,7 @@ TEST(ElementsAreTest, WorksWithNativeArrayPassedByReference) {
class NativeArrayPassedAsPointerAndSize { class NativeArrayPassedAsPointerAndSize {
public: public:
NativeArrayPassedAsPointerAndSize() {} NativeArrayPassedAsPointerAndSize() = default;
MOCK_METHOD(void, Helper, (int* array, int size)); MOCK_METHOD(void, Helper, (int* array, int size));
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
// clash with ::testing::Mock. // clash with ::testing::Mock.
class Mock { class Mock {
public: public:
Mock() {} Mock() = default;
MOCK_METHOD0(DoThis, void()); MOCK_METHOD0(DoThis, void());
...@@ -78,7 +78,7 @@ class CallsMockMethodInDestructor { ...@@ -78,7 +78,7 @@ class CallsMockMethodInDestructor {
class Foo { class Foo {
public: public:
virtual ~Foo() {} virtual ~Foo() = default;
virtual void DoThis() = 0; virtual void DoThis() = 0;
virtual int DoThat(bool flag) = 0; virtual int DoThat(bool flag) = 0;
...@@ -86,7 +86,7 @@ class Foo { ...@@ -86,7 +86,7 @@ class Foo {
class MockFoo : public Foo { class MockFoo : public Foo {
public: public:
MockFoo() {} MockFoo() = default;
void Delete() { delete this; } void Delete() { delete this; }
MOCK_METHOD0(DoThis, void()); MOCK_METHOD0(DoThis, void());
...@@ -109,7 +109,7 @@ class MockBar { ...@@ -109,7 +109,7 @@ class MockBar {
(a10 ? 'T' : 'F'); (a10 ? 'T' : 'F');
} }
virtual ~MockBar() {} virtual ~MockBar() = default;
const std::string& str() const { return str_; } const std::string& str() const { return str_; }
......
...@@ -98,7 +98,7 @@ class NonDefaultConstructible { ...@@ -98,7 +98,7 @@ class NonDefaultConstructible {
class MockA { class MockA {
public: public:
MockA() {} MockA() = default;
MOCK_METHOD1(DoA, void(int n)); MOCK_METHOD1(DoA, void(int n));
MOCK_METHOD1(ReturnResult, Result(int n)); MOCK_METHOD1(ReturnResult, Result(int n));
...@@ -113,7 +113,7 @@ class MockA { ...@@ -113,7 +113,7 @@ class MockA {
class MockB { class MockB {
public: public:
MockB() {} MockB() = default;
MOCK_CONST_METHOD0(DoB, int()); // NOLINT MOCK_CONST_METHOD0(DoB, int()); // NOLINT
MOCK_METHOD1(DoB, int(int n)); // NOLINT MOCK_METHOD1(DoB, int(int n)); // NOLINT
...@@ -125,7 +125,7 @@ class MockB { ...@@ -125,7 +125,7 @@ class MockB {
class ReferenceHoldingMock { class ReferenceHoldingMock {
public: public:
ReferenceHoldingMock() {} ReferenceHoldingMock() = default;
MOCK_METHOD1(AcceptReference, void(std::shared_ptr<MockA>*)); MOCK_METHOD1(AcceptReference, void(std::shared_ptr<MockA>*));
...@@ -143,12 +143,12 @@ class ReferenceHoldingMock { ...@@ -143,12 +143,12 @@ class ReferenceHoldingMock {
class CC { class CC {
public: public:
virtual ~CC() {} virtual ~CC() = default;
virtual int Method() = 0; virtual int Method() = 0;
}; };
class MockCC : public CC { class MockCC : public CC {
public: public:
MockCC() {} MockCC() = default;
MOCK_METHOD0(Method, int()); MOCK_METHOD0(Method, int());
...@@ -1881,7 +1881,7 @@ struct Unprintable { ...@@ -1881,7 +1881,7 @@ struct Unprintable {
class MockC { class MockC {
public: public:
MockC() {} MockC() = default;
MOCK_METHOD6(VoidMethod, void(bool cond, int n, std::string s, void* p, MOCK_METHOD6(VoidMethod, void(bool cond, int n, std::string s, void* p,
const Printable& x, Unprintable y)); const Printable& x, Unprintable y));
...@@ -2121,7 +2121,7 @@ void PrintTo(PrintMeNot /* dummy */, ::std::ostream* /* os */) { ...@@ -2121,7 +2121,7 @@ void PrintTo(PrintMeNot /* dummy */, ::std::ostream* /* os */) {
class LogTestHelper { class LogTestHelper {
public: public:
LogTestHelper() {} LogTestHelper() = default;
MOCK_METHOD1(Foo, PrintMeNot(PrintMeNot)); MOCK_METHOD1(Foo, PrintMeNot(PrintMeNot));
......
...@@ -40,13 +40,13 @@ using ::testing::Return; ...@@ -40,13 +40,13 @@ using ::testing::Return;
class FooInterface { class FooInterface {
public: public:
virtual ~FooInterface() {} virtual ~FooInterface() = default;
virtual void DoThis() = 0; virtual void DoThis() = 0;
}; };
class MockFoo : public FooInterface { class MockFoo : public FooInterface {
public: public:
MockFoo() {} MockFoo() = default;
MOCK_METHOD0(DoThis, void()); MOCK_METHOD0(DoThis, void());
......
...@@ -194,7 +194,7 @@ using testing::MatchesRegex; ...@@ -194,7 +194,7 @@ using testing::MatchesRegex;
class Interface { class Interface {
public: public:
virtual ~Interface() {} virtual ~Interface() = default;
virtual void VoidFromString(char* str) = 0; virtual void VoidFromString(char* str) = 0;
virtual char* StringFromString(char* str) = 0; virtual char* StringFromString(char* str) = 0;
virtual int IntFromString(char* str) = 0; virtual int IntFromString(char* str) = 0;
...@@ -208,7 +208,7 @@ class Interface { ...@@ -208,7 +208,7 @@ class Interface {
class Mock : public Interface { class Mock : public Interface {
public: public:
Mock() {} Mock() = default;
MOCK_METHOD1(VoidFromString, void(char* str)); MOCK_METHOD1(VoidFromString, void(char* str));
MOCK_METHOD1(StringFromString, char*(char* str)); MOCK_METHOD1(StringFromString, char*(char* str));
......
...@@ -53,7 +53,7 @@ using testing::Value; ...@@ -53,7 +53,7 @@ using testing::Value;
class MockFoo { class MockFoo {
public: public:
MockFoo() {} MockFoo() = default;
MOCK_METHOD3(Bar, char(const std::string& s, int i, double x)); MOCK_METHOD3(Bar, char(const std::string& s, int i, double x));
MOCK_METHOD2(Bar2, bool(int x, int y)); MOCK_METHOD2(Bar2, bool(int x, int y));
......
...@@ -107,13 +107,13 @@ class MatchResultListener { ...@@ -107,13 +107,13 @@ class MatchResultListener {
MatchResultListener& operator=(const MatchResultListener&) = delete; MatchResultListener& operator=(const MatchResultListener&) = delete;
}; };
inline MatchResultListener::~MatchResultListener() {} inline MatchResultListener::~MatchResultListener() = default;
// An instance of a subclass of this knows how to describe itself as a // An instance of a subclass of this knows how to describe itself as a
// matcher. // matcher.
class GTEST_API_ MatcherDescriberInterface { class GTEST_API_ MatcherDescriberInterface {
public: public:
virtual ~MatcherDescriberInterface() {} virtual ~MatcherDescriberInterface() = default;
// Describes this matcher to an ostream. The function should print // Describes this matcher to an ostream. The function should print
// a verb phrase that describes the property a value matching this // a verb phrase that describes the property a value matching this
...@@ -494,7 +494,7 @@ template <> ...@@ -494,7 +494,7 @@ template <>
class GTEST_API_ Matcher<const std::string&> class GTEST_API_ Matcher<const std::string&>
: public internal::MatcherBase<const std::string&> { : public internal::MatcherBase<const std::string&> {
public: public:
Matcher() {} Matcher() = default;
explicit Matcher(const MatcherInterface<const std::string&>* impl) explicit Matcher(const MatcherInterface<const std::string&>* impl)
: internal::MatcherBase<const std::string&>(impl) {} : internal::MatcherBase<const std::string&>(impl) {}
...@@ -516,7 +516,7 @@ template <> ...@@ -516,7 +516,7 @@ template <>
class GTEST_API_ Matcher<std::string> class GTEST_API_ Matcher<std::string>
: public internal::MatcherBase<std::string> { : public internal::MatcherBase<std::string> {
public: public:
Matcher() {} Matcher() = default;
explicit Matcher(const MatcherInterface<const std::string&>* impl) explicit Matcher(const MatcherInterface<const std::string&>* impl)
: internal::MatcherBase<std::string>(impl) {} : internal::MatcherBase<std::string>(impl) {}
...@@ -544,7 +544,7 @@ template <> ...@@ -544,7 +544,7 @@ template <>
class GTEST_API_ Matcher<const internal::StringView&> class GTEST_API_ Matcher<const internal::StringView&>
: public internal::MatcherBase<const internal::StringView&> { : public internal::MatcherBase<const internal::StringView&> {
public: public:
Matcher() {} Matcher() = default;
explicit Matcher(const MatcherInterface<const internal::StringView&>* impl) explicit Matcher(const MatcherInterface<const internal::StringView&>* impl)
: internal::MatcherBase<const internal::StringView&>(impl) {} : internal::MatcherBase<const internal::StringView&>(impl) {}
...@@ -570,7 +570,7 @@ template <> ...@@ -570,7 +570,7 @@ template <>
class GTEST_API_ Matcher<internal::StringView> class GTEST_API_ Matcher<internal::StringView>
: public internal::MatcherBase<internal::StringView> { : public internal::MatcherBase<internal::StringView> {
public: public:
Matcher() {} Matcher() = default;
explicit Matcher(const MatcherInterface<const internal::StringView&>* impl) explicit Matcher(const MatcherInterface<const internal::StringView&>* impl)
: internal::MatcherBase<internal::StringView>(impl) {} : internal::MatcherBase<internal::StringView>(impl) {}
......
...@@ -133,7 +133,7 @@ std::ostream& operator<<(std::ostream& os, const TestPartResult& result); ...@@ -133,7 +133,7 @@ std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
// virtual. // virtual.
class GTEST_API_ TestPartResultArray { class GTEST_API_ TestPartResultArray {
public: public:
TestPartResultArray() {} TestPartResultArray() = default;
// Appends the given TestPartResult to the array. // Appends the given TestPartResult to the array.
void Append(const TestPartResult& result); void Append(const TestPartResult& result);
...@@ -154,7 +154,7 @@ class GTEST_API_ TestPartResultArray { ...@@ -154,7 +154,7 @@ class GTEST_API_ TestPartResultArray {
// This interface knows how to report a test part result. // This interface knows how to report a test part result.
class GTEST_API_ TestPartResultReporterInterface { class GTEST_API_ TestPartResultReporterInterface {
public: public:
virtual ~TestPartResultReporterInterface() {} virtual ~TestPartResultReporterInterface() = default;
virtual void ReportTestPartResult(const TestPartResult& result) = 0; virtual void ReportTestPartResult(const TestPartResult& result) = 0;
}; };
......
...@@ -894,7 +894,7 @@ class GTEST_API_ TestSuite { ...@@ -894,7 +894,7 @@ class GTEST_API_ TestSuite {
class Environment { class Environment {
public: public:
// The d'tor is virtual as we need to subclass Environment. // The d'tor is virtual as we need to subclass Environment.
virtual ~Environment() {} virtual ~Environment() = default;
// Override this to define how to set up the environment. // Override this to define how to set up the environment.
virtual void SetUp() {} virtual void SetUp() {}
...@@ -925,7 +925,7 @@ class GTEST_API_ AssertionException ...@@ -925,7 +925,7 @@ class GTEST_API_ AssertionException
// the order the corresponding events are fired. // the order the corresponding events are fired.
class TestEventListener { class TestEventListener {
public: public:
virtual ~TestEventListener() {} virtual ~TestEventListener() = default;
// Fired before any test activity starts. // Fired before any test activity starts.
virtual void OnTestProgramStart(const UnitTest& unit_test) = 0; virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
...@@ -1671,7 +1671,7 @@ template <typename T> ...@@ -1671,7 +1671,7 @@ template <typename T>
class WithParamInterface { class WithParamInterface {
public: public:
typedef T ParamType; typedef T ParamType;
virtual ~WithParamInterface() {} virtual ~WithParamInterface() = default;
// The current parameter value. Is also available in the test fixture's // The current parameter value. Is also available in the test fixture's
// constructor. // constructor.
......
...@@ -88,7 +88,7 @@ class GTEST_API_ DeathTest { ...@@ -88,7 +88,7 @@ class GTEST_API_ DeathTest {
static bool Create(const char* statement, Matcher<const std::string&> matcher, static bool Create(const char* statement, Matcher<const std::string&> matcher,
const char* file, int line, DeathTest** test); const char* file, int line, DeathTest** test);
DeathTest(); DeathTest();
virtual ~DeathTest() {} virtual ~DeathTest() = default;
// A helper class that aborts a death test when it's deleted. // A helper class that aborts a death test when it's deleted.
class ReturnSentinel { class ReturnSentinel {
...@@ -153,7 +153,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 ...@@ -153,7 +153,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
// Factory interface for death tests. May be mocked out for testing. // Factory interface for death tests. May be mocked out for testing.
class DeathTestFactory { class DeathTestFactory {
public: public:
virtual ~DeathTestFactory() {} virtual ~DeathTestFactory() = default;
virtual bool Create(const char* statement, virtual bool Create(const char* statement,
Matcher<const std::string&> matcher, const char* file, Matcher<const std::string&> matcher, const char* file,
int line, DeathTest** test) = 0; int line, DeathTest** test) = 0;
......
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