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
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user