I have a mock function:
MOCK_METHOD4(my_func, int(double, double, void* (*cb) (int), int p1));
I want to invoke 2nd (0-based) argument of above function with the 3rd argument as parameter, i.e., invoke "cb" function with "p1" as parameter. How can I do that?
I can invoke "cb" with some custom value using InvokeArgument:
ON_CALL(mockObj, my_func(_, _, _, _)).
WillByDefault(DoAll(
IgnoreResult(InvokeArgument<2>(10)),
Return(0)));
But I want to invoke it with an actual parameter passed to the same mocked function call.