Is there any convenient way to match one argument against another one (which is a wildcard)? For example:
ON_CALL(calculator_mock, division(_, SameAsArgument<0>).WillByDefault(Return(1.0))
Is there such matcher like SameAsArgument ?
UPDATE: maybe SameAsArgument<N>
is not very good. What I need is a matcher Argument<N>
, which will get the value of N-th argument.
Thanks!
Yes, that can be done like explained in the "Matching Multiple Arguments as a Whole" chapter of their cookbook.
In your case, should be :