Hello Group,
The rest of the error message is, "The mock function has no default action set, and its return type has no default value set."
I am a complete noob wrt Google Mock. I have searched existing posts looking for the terms "uninteresting" and "default action". Both searches have gotten me close to an answer, but I still have no solution.
There are two parts to my question:
First, I want to know why gmock considers the call "uninteresting". In my MockSomeObj class, derived from the SomeObj class, I have defined a public MOCK_METHOD:
MOCK_METHOD2(ObjMethod, ReturnType(ParamType1, ParamType2);
In my TEST_F(), I have
EXPECT_CALL(myObj, ObjMethod(ParamType1 var1, ParamType2 var2)).Times(1);
EXPECT_EQ(ExpectedReturnTypeValue, MyTest.MethodExpectingObjMethodCalledOn_myObj(var1, var2);
My understanding of gmock is that a method named in the EXPECT_CALL macro should make the call "interesting," since I am interested enough to use the EXPECT_CALL macro. Obviously, this is not the case, since I am receiving the error on the call to myObj.ObjMethod().
Can someone please tell me what the correct interpretation of "uninteresting mock function call" is?
Second, I believe that I have already supplied a "default action" for the method with the Times() expression. That still did not supply a "default value," so I changed the EXPECT_CALL:
EXPECT_CALL(myObj, ObjMethod(var1, var2)).WillOnce(Return(ExpectedReturnTypeValue));
How is it that specifying an expected return value does not supply a "default value?"
I apologize if these questions have already been answered, but I was unable to find anything specific to my issue in my searches, and applying whatever generic solutions that I found to my specific issue did not resolve it.
Thank you,
Richard F. Johnson