This allows ON_CALL and EXPECT_CALL to reference the mock function from outside of the mock class. (Yes, C++ allows a subclass to change the access level of a virtual function in the base class.) Example:class Foo { public: ... virtual bool Transform(Gadget* g) = 0; protected: ...
{: .callout .note} Note: if you don't mock all versions of the overloaded method, the compiler will give you a warning about some methods in the base class being hidden. To fix that, use using to bring them in scope:class MockFoo : public Foo { ... using Foo::Add; M...
regardless of the method being mocked beingpublic,protected, orprivatein the base class. This allowsON_CALLandEXPECT_CALLto reference the mock function from outside of the mock class. (Yes, C++ allows a subclass to change the access level of a virtual function in the base class...