11
我有一個接口ITEST:gmock多個進出參數SetArgReferee
class Itest {
bool testfunction(vector<int>& v, int& id);
}
我可以嘲笑它:
MOCK_METHOD2(testfunction, bool(vector<int>&, int&))
,但我怎麼可以設定的返回值?
我想:
vector<int> v;
int i;
EXPECT_CALL(testobject, testfunction(_,_, _))
.WillOnce(testing::SetArgReferee<0>(v))
.WillOnce(testing::SetArgReferee<1>(i))
.WillOnce(Return(true));
但隨後它被稱爲三次..
如何設置這些argReferees
和返回值的一個時間?