1
符合我的論點我有一類像gmock匹配不參照
int foo(const bar& b) const;
一個嘲笑功能被嘲笑像
MOCK_CONST_METHOD1(foo, int(const bar& b));
爲此,我已經設置設置一些默認操作像
ON_CALL(anObject, foo(bar(0,0))).WillByDefault(Return(1));
我的測試代碼調用
anObject.foo(bar(0,0);
而不是返回1,但,gmock給我以下錯誤:
Uninteresting mock function call - returning default value.
Function call: foo(@0xbfffcf90 8-byte object <00-00 00-00 00-00 00-00>)
The mock function has no default action set, and its return type has no default value set.
的operator ==
針對對象bar
定義。爲什麼不能gmock找到我的默認操作?