In some of our tests we expect a single call to a function that has a large structure as an input parameter. We want to test if a subset of the members of this structure are set to certain values. Because the structure is so large, we
are interested in knowing which fields differed if the expectation
didn't match.
We could create a matcher with the MATCHER macro, but if the expectation is not matched we can only see the generic message for this matcher.
We could add prints to the matcher (and it will work in our case), but matchers are not supposed to have side-effects because they may be evaluated multiple times.
Alternatively we could accept any value for the structure in the expectation (testing::_) and define an ACTION that prints how the actual structure differs from the one we expect.
Maybe there are other options that I haven't considered.
What would be the best way to deal with this situation?
Best regards,
Maurice.