Args<1> is a selector for a one-dimensional tuple, so your code can be made to compile if it looks like this:
EXPECT_CALL(mocker, doSomethingElse(_, _)).Times(Exactly(1))
.With(Args<1>(Eq(tr1::make_tuple(10))));
I admit that looks a little awkward; I' don't know whether or not there's a better way.
On Wednesday, June 5, 2013 1:12:03 PM UTC-4, Joe Boese wrote:
Hey Guys,I'm having a heck of a time figuring out what is wrong with the following line:
EXPECT_CALL(mocker, doSomethingElse(_, _)).Times(Exactly(1)).With(Args<1>(Eq(10)));
My class definition is as follows:
class MockBase : public Base {
public:
MOCK_METHOD2(doSomething, void(int x, char y));
MOCK_METHOD2(doSomethingElse, void(const char* value, int len));
};
This fails to compile with:
googlemock/gmock-1.6.0/include/gmock/gmock-matchers.h:738: error: no match for ‘operator==’ in ‘lhs == ((const testing::internal::EqMatcher<int>::Impl<const std::tr1::tuple<int>&>*)this)->testing::internal::EqMatcher<int>::Impl<const std::tr1::tuple<int>&>::rhs_’
I expect that this would end up evaluating to "Check that the second argument in the call to doSomethingElse() is equal to 10. I realize there are other simpler ways to express what I'm doing here; however I'm building up to a more complicated With/AllOf call.
Thanks
Joe
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Mocking Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googlemock+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.