Hi Amanda,
Thanks for quick reply.
i tried doing what you have suggested but still it is throwing the
same error.
I have mocked methods in my interface class which is abstract.
now in one of the tests i expect a call to my mock method which
returns a reference to other interface method.
how can i test this scenario.
here is the sample code:
class iface_a
{
public:
virtual ~iface_a() {};
virtual pthmgmt::iface_b& Getiface_b() =0;
};
class mock_iface_a : public iface_a
{
public:
virtual ~mock_iface_a() { };
MOCK_METHOD0(Getiface_b, pthgmt::iface_b&());
};
now when i am trying to check the invocation as below:
EXPECT_CALL(obj_mock_iface_a, Getiface_b)
.Times(Atleast(1));
this is throwing the error i mentioned earlier.
the test is aborted with message:
"The mock function has no default action set, and its return type has
no default value set."
Could you be of any help?
--vdevarap
On Jul 8, 4:58 pm, Amanda Robinson <
amandarobin...@google.com> wrote:
> If you expect no call, then you should test for that and use StrictMock.
>
> If you don't care, you still need to set a default response:
> ON_CALL(MockClass, DoSomething(int))
> .WillRepeatedly(Return(0));
>