I was attempting to mock a private function when I ran into the accessibility issue. The Turtle documentation states to explicitly state the signature in MOCK_METHOD's third parameter. When I do that (in Visual Studio 2012), I get the following warning:
warning C4002: too many actual parameters for macro 'MOCK_METHOD'
Followed by the inaccessble member error:
error C2248: 'MyClass::someFunctionName' : cannot access private member declared in class 'MyClass'
So, the suggestion in the documentation doesn't seem to fix the problem, and the three parameter variant of MOCK_METHOD causes the extra warning.
MOCK_METHOD_EXT and including the signature and a custom identifier fixes the problem, but this is not the documented solution.
Log in to post a comment.