Add ck_assert_pstr_* macros with ability to compare undefined (NULL) strings#80
Merged
Merged
Conversation
Contributor
|
Jenkins: ok to test |
brarcher
reviewed
Dec 11, 2016
| @item ck_assert_ptr_eq | ||
| @itemx ck_assert_ptr_ne | ||
|
|
||
| Similar to @code{ck_assert_str_*} macros, but able to check undefined strings. |
Contributor
There was a problem hiding this comment.
Did you intend this section to be before the ck_assert_ptr_* macros?
brarcher
reviewed
Dec 11, 2016
| of the character string @code{a} is less than that of @code{b}. | ||
| If a NULL pointer would be passed to any comparison macro than check would fail. | ||
|
|
||
| @item ck_assert_str_eq |
Contributor
There was a problem hiding this comment.
Did you mean ck_asserts_pstr_eq
brarcher
reviewed
Dec 12, 2016
| */ | ||
| #define ck_assert_pstr_ne(X, Y) _ck_assert_str(X, !=, Y, 0, 1) | ||
|
|
||
| /* Memory location comparison macros with improved output compared to ck_assert() */ |
Contributor
There was a problem hiding this comment.
This looks like a duplicate of what comes after it. Did you mean to include it?
Contributor
Author
There was a problem hiding this comment.
Do you mean that ck_assert_pstr_ne does the same as ck_assert_str_ne does? If so, no, ck_assert_str_ne always fails if NULL passed.
64969bc to
7bfaba6
Compare
7bfaba6 to
e678590
Compare
Contributor
|
Thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I decided to open another merge request for this feature to simplify code review. So fist ck_assert_str_* fixes could be merged and then these.