Skip to content

How pointers should be verifies as null? #448

Answered by Snaipe
IsraelBuitronD asked this question in Q&A
Discussion options

You must be logged in to vote

The zero criterion is what you want: https://criterion.readthedocs.io/en/v2.4.1/assert.html#c.zero

cr_assert(zero(ptr, mypointer));
cr_assert(not(zero(ptr, mypointer)));

More examples on how to use the new assertions can be seen in the asserts.c sample

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Snaipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants