I created a test mock class pretty much as simple as described in the docs:
class MockLogicLoopable : public LogicLoopable
{
public:
MOCK_METHOD0(update,void());
MOCK_METHOD0(loopableType,LoopableType());
};
Now I'd like to do something like this:
TEST(Examplegroup,Example)
{
MockLogicLoopable* mll = new MockLogicLoopable();
EXPECT_CALL(mll,loopableType())
.WillRepeatedly(Return(LOGIC));
}
I'm not really sure how, if at all, something like this can be realized with googlemock.
You have a pointer in mll, but EXPECT_CALL expects its first argument to be a value. Dereference your pointer with *, just as you would any other:
EXPECT_CALL(*mll, loopableType())
.WillRepeatedly(Return(LOGIC));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With