On Fri, Nov 13, 2009 at 2:15 PM, Edison Gustavo Muenz
<
edison...@gmail.com> wrote:
> Hello everyone, consider I have this kind of class to mock:
> class ClassToMock {
> public:
> virtual bool testMethod(int& a) {
> a= 10;
> return true;
> }
> };
> so I write:
> class MockedA : public ClassToMock
> {
> public:
> MOCK_METHOD1(testMethod, bool(int&));
> };
> then I want to write on my tests:
> MockedA mock;
> EXPECT_CALL(mock, testMethod(_))
> .WillOnce(DoAll(Return(false), SetArgReferee<0>(5)));
> Saying that when the 'testMethod' is invoked it will return false and set
> its arg as 5.
> But I'm not allowed to do that, I get lots of compile errors, am I doing
> something unusual here?
You should swap the two arguments to DoAll(). In other words, set the