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

Side effects with EXPECT_XX macros #1

Open
CJLove opened this issue Jun 4, 2020 · 0 comments
Open

Side effects with EXPECT_XX macros #1

CJLove opened this issue Jun 4, 2020 · 0 comments

Comments

@CJLove
Copy link
Owner

CJLove commented Jun 4, 2020

If the function under test is called directly as an argument in one of the EXPECT_XX() macros and the test fails then the function is called a 2nd time when reporting the test failure:

EXPECT_EQ(1,my_test_func());

Workaround is to call the function under test first:

int result = my_test_func();
EXPECT_EQ(1,result);
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

No branches or pull requests

1 participant