Skip to content

Add ck_assert_pstr_* macros with ability to compare undefined (NULL) strings#80

Merged
brarcher merged 3 commits into
libcheck:masterfrom
andr-dots:pstr_comparisons
Dec 13, 2016
Merged

Add ck_assert_pstr_* macros with ability to compare undefined (NULL) strings#80
brarcher merged 3 commits into
libcheck:masterfrom
andr-dots:pstr_comparisons

Conversation

@andr-dots

Copy link
Copy Markdown
Contributor

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.

@brarcher

Copy link
Copy Markdown
Contributor

Jenkins: ok to test

Comment thread doc/check.texi
@item ck_assert_ptr_eq
@itemx ck_assert_ptr_ne

Similar to @code{ck_assert_str_*} macros, but able to check undefined strings.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend this section to be before the ck_assert_ptr_* macros?

Comment thread doc/check.texi Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean ck_asserts_pstr_eq

Comment thread src/check.h.in
*/
#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() */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a duplicate of what comes after it. Did you mean to include it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@brarcher brarcher merged commit bc935ce into libcheck:master Dec 13, 2016
@brarcher

Copy link
Copy Markdown
Contributor

Thanks for the contribution!

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.

2 participants