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

Add CHECK_EQUAL_ZERO macros #1423

Merged
merged 2 commits into from
Sep 17, 2020
Merged

Conversation

rnestler
Copy link
Contributor

These are useful when working with error code return values, where one
often compares to zero which means no error has happened.

@coveralls
Copy link

coveralls commented Sep 16, 2020

Coverage Status

Coverage remained the same at 99.833% when pulling 57b1558 on rnestler:add-CHECK_ZERO-macros into e6e050b on cpputest:master.

@basvodde
Copy link
Member

No test?

@rnestler
Copy link
Contributor Author

No test?

Since they are just aliases for CHECK_EQUAL I'm not sure if it makes much sense to add tests.

But I guess I could add some tests to tests/CppUTest/TestUTestMacro.cpp similar to the CHECK_EQUAL tests. Would that be good?

@basvodde
Copy link
Member

Yes, please do put a test there, and perhaps also tests that it behaves properly as a macro.

I'd suggest CHECK_EQUAL_ZERO instead to CHECK_ZERO.

These are useful when working with error code return values, where one
often compares to zero which means no error has happened.
@rnestler rnestler force-pushed the add-CHECK_ZERO-macros branch 2 times, most recently from c5980e7 to 7fbbec2 Compare September 17, 2020 09:42
@rnestler
Copy link
Contributor Author

I did the rename and added some tests.

Btw. It took me quite some time to figure out how to run the tests (apparently make check ). It would be nice to have a developer contributing guide. Maybe add a CONTRIBUTING.md with instructions to describe how to contribute to the project.

@basvodde
Copy link
Member

Sorry, how to run the tests also does depend on the build system that you are using. We support multiple.

The test failed though.

@rnestler
Copy link
Contributor Author

The test failed though.

A copy paste error 🙈

@rnestler rnestler changed the title Add CHECK_ZERO macros Add CHECK_EQUAL_ZERO macros Sep 17, 2020
@basvodde basvodde merged commit 52cce33 into cpputest:master Sep 17, 2020
@rnestler rnestler deleted the add-CHECK_ZERO-macros branch September 21, 2020 12:06
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.

None yet

3 participants