Friday, 27 September 2013

Getting failed expectations from GMock

Getting failed expectations from GMock

Currently, I am using GMock without GTest ( specifically, I'm using it
with mstest ). Is there any way to get a string of the failed expectations
?
IE:
EXPECT_CALL( mockObject, MethodWith3Params( 1, 2, 3 ) ).Times(1);
// Do does not call MethodWith3Params at all.
stuffDoer.Do( mockObject);
Assert::IsTrue( Mock::VerifyAndClearExpectations( &mockObject ), " "/*What
can I do here to say what expectation/s failed ?*/ );
I assume GMock is storing these strings ( or at least raw data that can be
used to deduce a message ) somewhere, since GTest is able to tell you when
an expectation isn't met.

No comments:

Post a Comment