GUnit
GUnit copied to clipboard
:bug: Fix printing variables when expect or assert fails
Problem:
- EXPECT and ASSERT macros only print whether the expression is true or false when the test expectations fail
- GUnit stopped printing out the values of the variables used in the expressiong passed to the EXPECT or ASSERT macros
- Fix for logical expression broke variable printing
Solution:
- Remove extra parenthesis in macros that resulted in full evaluation of the expression before the op and cmp objects could be initialized.
- Add CmpHelperAnd/Or/Xor with corresponding and/or/xor overloads to allow evaluating logical expressions.
- Added test to verify tested expressions are only evaluated once.
thanks @dustingooding, LGTM, just a small complain from the compiler about C++20, otherwise happy to get that in.
Actually, I don't think these errors are because of my changes. It looks like the MacOS and Windows failures started with #102?