Remove the legacy internal GTEST_DISALLOW_* macros

PiperOrigin-RevId: 443715444
Change-Id: I3ffd54b63d2728ae4a668ee7875c8c3c8188087c
This commit is contained in:
Derek Mauro
2022-04-22 11:26:03 -07:00
committed by Copybara-Service
parent b85864c647
commit bf66935e07
32 changed files with 290 additions and 159 deletions
+8 -4
View File
@@ -393,7 +393,8 @@ class DefaultValue {
private:
const T value_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer);
FixedValueProducer(const FixedValueProducer&) = delete;
FixedValueProducer& operator=(const FixedValueProducer&) = delete;
};
class FactoryValueProducer : public ValueProducer {
@@ -404,7 +405,8 @@ class DefaultValue {
private:
const FactoryFunction factory_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer);
FactoryValueProducer(const FactoryValueProducer&) = delete;
FactoryValueProducer& operator=(const FactoryValueProducer&) = delete;
};
static ValueProducer* producer_;
@@ -478,7 +480,8 @@ class ActionInterface {
virtual Result Perform(const ArgumentTuple& args) = 0;
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);
ActionInterface(const ActionInterface&) = delete;
ActionInterface& operator=(const ActionInterface&) = delete;
};
// An Action<F> is a copyable and IMMUTABLE (except by assignment)
@@ -951,7 +954,8 @@ class ReturnAction {
R value_before_cast_;
Result value_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
};
// Partially specialize for ByMoveWrapper. This version of ReturnAction will
+5 -2
View File
@@ -313,7 +313,9 @@ class StringMatchResultListener : public MatchResultListener {
private:
::std::stringstream ss_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener);
StringMatchResultListener(const StringMatchResultListener&) = delete;
StringMatchResultListener& operator=(const StringMatchResultListener&) =
delete;
};
// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
@@ -2555,7 +2557,8 @@ class WhenSortedByMatcher {
const Comparator comparator_;
const Matcher<const ::std::vector<LhsValue>&> matcher_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
Impl(const Impl&) = delete;
Impl& operator=(const Impl&) = delete;
};
private:
+6 -3
View File
@@ -169,7 +169,8 @@ class GTEST_INTERNAL_EMPTY_BASE_CLASS NiceMock
}
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock);
NiceMock(const NiceMock&) = delete;
NiceMock& operator=(const NiceMock&) = delete;
};
template <class MockClass>
@@ -210,7 +211,8 @@ class GTEST_INTERNAL_EMPTY_BASE_CLASS NaggyMock
}
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(NaggyMock);
NaggyMock(const NaggyMock&) = delete;
NaggyMock& operator=(const NaggyMock&) = delete;
};
template <class MockClass>
@@ -251,7 +253,8 @@ class GTEST_INTERNAL_EMPTY_BASE_CLASS StrictMock
}
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock);
StrictMock(const StrictMock&) = delete;
StrictMock& operator=(const StrictMock&) = delete;
};
#undef GTEST_INTERNAL_EMPTY_BASE_CLASS
@@ -677,7 +677,8 @@ class GTEST_API_ InSequence {
private:
bool sequence_created_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(InSequence); // NOLINT
InSequence(const InSequence&) = delete;
InSequence& operator=(const InSequence&) = delete;
} GTEST_ATTRIBUTE_UNUSED_;
namespace internal {
@@ -1219,7 +1220,8 @@ class TypedExpectation : public ExpectationBase {
Matcher<const ArgumentTuple&> extra_matcher_;
Action<F> repeated_action_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(TypedExpectation);
TypedExpectation(const TypedExpectation&) = delete;
TypedExpectation& operator=(const TypedExpectation&) = delete;
}; // class TypedExpectation
// A MockSpec object is used by ON_CALL() or EXPECT_CALL() for
@@ -1392,7 +1394,8 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
Wrapper result_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
ActionResultHolder(const ActionResultHolder&) = delete;
ActionResultHolder& operator=(const ActionResultHolder&) = delete;
};
// Specialization for T = void.
@@ -1425,7 +1428,8 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase {
private:
ActionResultHolder() {}
GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
ActionResultHolder(const ActionResultHolder&) = delete;
ActionResultHolder& operator=(const ActionResultHolder&) = delete;
};
template <typename F>