I am trying to set the wait on a gmock object. The wait should apply whenever "avout" is passed as an argument to my method. I set this expectation:
EXPECT_CALL(actx_mock, getDeviceClientService(TypedEq<const char*>("avout"),_,_)).WillOnce(DoAll(SetArgPointee<2>(&mockAVOut), Return(0)));
TypedEq is necessary because the method is overloaded, accepting either a string or const char *. When I run my test, I get the following error:
CAniSpiceServices_test.cpp:1357: EXPECT_CALL(actx_mock, getDeviceClientService(TypedEq<const char*>("avout"),_,_))...
Expected arg
Actual: 0x7fbc6861370d pointing to "avout"
So it looks like the string is the same, since it points another instance of this string to a different address, does it not match? Is there a way to make it match any string that matches this value, regardless of address?
source
share