Matching arguments of custom type in googlemock
问题 I have a problem matching a function argument to a specific object using google mock. Consider the following code: class Foo { public: struct Bar { int foobar; } void myMethod(const Bar& bar); } Now I have some testing code, it could look like this: Foo::Bar bar; EXPECT_CALL(fooMock, myMethod(Eq(bar)); So I want to make sure that when Foo::myMethod is called, the argument looks like my locally instantiated bar object. When I try this approach I get an error message like: gmock/gmock-matchers