GMOCK ON_CALL how to select right overloaded mock #4567
Unanswered
zokroj
asked this question in
Community Help
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am having issues trying to use ON_CALL with overloaded methods. I have something like the following:
MOCK_METHOD(RequestResult, request, (const Type1 a));
MOCK_METHOD(RequestResult, request, (const Type 2 &b));
When I set the ON_CALL like this:
ON_CALL(mock, request(_)).WillByDefault(testing::Invoke([&](){ }));
the compiler is complaining about call to be ambiguous, if I try to use the Matchers:
ON_CALL(mock, request(testing::A<Type1>()).WillByDefault(testing::Invoke([&](){ }));
I get the following:
note: candidate function not viable: no known conversion from 'Matcher<>' to 'const ::testing::internal::WithoutMatchers' for 1st argument
I am using gtest version 1.11 - any hints?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions