I’m using google mock. The document says that we can use EXPECT_THAT in EXPECT_CALL or ON_CALL, but code like this doesn’t seem to compile:
EXPECT_CALL(obj, method(_, _)).Times(1).WillOnce(EXPECT_THAT(true, Eq(1)));
I know EXPECT_THAT is a macro so it expands to some statements that shouldn’t appear there. So what does “use EXPECT_THAT in EXPECT_CALL” mean? How to do it?
Thanks
You’ve misunderstood the documentation for matchers:
The docs then go on to give an example of how you could use a matcher to validate a value:
This is not saying that
EXPECT_THATis itself a matcher. So you can’t do what you’re attempting, but only something more like:or