I want to change different argument on different function call how to achieve this?
example:
EXPECT_CALL(*obj, Write(_)).WillOnce(DoAll(SaveArg<0>(&WriteObj), Return(true)));
The Write() method will be called multiple times or random times. On each Write calls I want to get the object passed to Write() method. I want these arguments in a vector, how can I do this?
Finally I solved my issue with this way.
in the test class
void SaveWritableObjects(WritableInterface * pWritableObject)
{
WritableObjectList.push_back(pWritableObject);
}
std::vector<WritableInterface *> WritableObjectList;
And in the test function
EXPECT_CALL(*pMFOI, Write(_)).WillRepeatedly(DoAll(Invoke(this, &intTestErrorEvents::SaveWritableObjects), Return(true)));