summaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/gmock-spec-builders.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-12-21 20:41:17 (GMT)
committerDerek Mauro <dmauro@google.com>2020-12-22 17:15:41 (GMT)
commitca4b7c9ff4d8a5c37ac51795b03ffe934958aeff (patch)
tree9b90d078223828eb4acf5b274e4cc3c5cb79ecfd /googlemock/include/gmock/gmock-spec-builders.h
parent4f6fa70870de48cf0db655acc9cb8c30b2760ec9 (diff)
downloadgoogletest-ca4b7c9ff4d8a5c37ac51795b03ffe934958aeff.zip
googletest-ca4b7c9ff4d8a5c37ac51795b03ffe934958aeff.tar.gz
googletest-ca4b7c9ff4d8a5c37ac51795b03ffe934958aeff.tar.bz2
Googletest export
Give each of Naggy/Nice/StrictMock a base class whose constructor runs before the mocked class's constructor, and a destructor that runs after the mocked class's destructor, so that any mock methods run in either the constructor or destructor use the same strictness as other calls. PiperOrigin-RevId: 348511612
Diffstat (limited to 'googlemock/include/gmock/gmock-spec-builders.h')
-rw-r--r--googlemock/include/gmock/gmock-spec-builders.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h
index ac21550..d42d4cb 100644
--- a/googlemock/include/gmock/gmock-spec-builders.h
+++ b/googlemock/include/gmock/gmock-spec-builders.h
@@ -108,6 +108,14 @@ template <typename F> class TypedExpectation;
// Helper class for testing the Expectation class template.
class ExpectationTester;
+// Helper classes for implementing NiceMock, StrictMock, and NaggyMock.
+template <typename MockClass>
+class NiceMockImpl;
+template <typename MockClass>
+class StrictMockImpl;
+template <typename MockClass>
+class NaggyMockImpl;
+
// Protects the mock object registry (in class Mock), all function
// mockers, and all expectations.
//
@@ -413,14 +421,12 @@ class GTEST_API_ Mock {
template <typename F>
friend class internal::FunctionMocker;
- template <typename M>
- friend class NiceMock;
-
- template <typename M>
- friend class NaggyMock;
-
- template <typename M>
- friend class StrictMock;
+ template <typename MockClass>
+ friend class internal::NiceMockImpl;
+ template <typename MockClass>
+ friend class internal::NaggyMockImpl;
+ template <typename MockClass>
+ friend class internal::StrictMockImpl;
// Tells Google Mock to allow uninteresting calls on the given mock
// object.