Piotr Gorak
unread,Feb 25, 2011, 10:06:43 AM2/25/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google C++ Mocking Framework
How about this: let's assume that I want to check only first two
elements of the array that passed as the 2nd argument of the mock
object function. I could add a small custom matcher:
MATCHER_P2(CheckFirstTwo, first, second)
{
return arg[0] == first && arg[1] == second;
}
And then:
EXPECT_CALL(myobj, MyMethod(_, CheckFirstTwo(1, 2), _)
or (since it will also work for other types)
EXPECT_CALL(myobj, MyMethod(_, CheckFirstTwo('a', 'b'), _)
Piotr