Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix printing variables when expect or assert fails #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dustingooding
Copy link
Contributor

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.

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.
@kris-jusiak
Copy link
Contributor

thanks @dustingooding, LGTM, just a small complain from the compiler about C++20, otherwise happy to get that in.

@dustingooding
Copy link
Contributor Author

Actually, I don't think these errors are because of my changes. It looks like the MacOS and Windows failures started with #102?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants