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

example: function call within assert #38

Closed
psychocoderHPC opened this issue Jul 14, 2022 · 2 comments
Closed

example: function call within assert #38

psychocoderHPC opened this issue Jul 14, 2022 · 2 comments

Comments

@psychocoderHPC
Copy link

I checked your library and looked into your test case to get a feeling of how your library should be used.
The test is using the pattern assert(VELOC_*()), this is dangerous because in cases where the code will be compiled with -DNDEBUG the function call within assert will not be executed because assert () is a noop.

example:

assert(VELOC_Restart("heatdis", v) == VELOC_SUCCESS);

assert(VELOC_Checkpoint("heatdis", i) == VELOC_SUCCESS);

I know that the code I pointed to is the test case of VELOC but users will most likely start with copy-pasting from existing code and therefore propagate the issue into their own codebase.

@bnicolae
Copy link
Contributor

Thanks for the feedback. Indeed, the intention was to make the example succinct, rather than a recommendation of how to use VELOC in production. We will fix this.

@bnicolae
Copy link
Contributor

Done, updated examples are now available

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

2 participants