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 pointer against NULL comparison macros #87

Merged
merged 3 commits into from
Dec 14, 2016
Merged

Conversation

9fcc
Copy link
Contributor

@9fcc 9fcc commented Dec 13, 2016

To fulfil the API set, missing pointer macros.

@brarcher
Copy link
Contributor

Jenkins: ok to test

@@ -230,6 +230,8 @@ static master_test_t master_tests[] = {
{ "Simple Tests", "test_ck_assert_pstr_ne_with_null", CK_FAILURE, "Assertion 't != s' failed: t == (null), s == (null)" },
{ "Simple Tests", "test_ck_assert_ptr_eq", CK_FAILURE, "Assertion 'x == y' failed: x == 0x1, y == 0x2" },
{ "Simple Tests", "test_ck_assert_ptr_ne", CK_FAILURE, "Assertion 'x != z' failed: x == 0x1, z == 0x1" },
{ "Simple Tests", "test_ck_assert_ptr_null", CK_FAILURE, "Assertion 'x == NULL' failed: x == 0x1" },
{ "Simple Tests", "test_ck_assert_ptr_nonnull", CK_FAILURE, "Assertion 'x != NULL' failed: x == 0" },
Copy link
Contributor

Choose a reason for hiding this comment

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

Should "NULL" be printed when the pointer is 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about it. This assert belongs to prt_* macros. And they just print pointer value. So I think printing NULL has no sense. Another way all ptr_* macros could be changed to print NULL instead of zero. Anyway, it could be a separate commit.

@@ -1217,6 +1217,17 @@ would pass.
@item ck_assert_ptr_eq
@itemx ck_assert_ptr_ne

Compares a pointers against null and displays predefined message with
condition and value of the input parameter on failure.
@code{@item ck_assert_ptr_null} checks that pointer is equal to NULL and
Copy link
Contributor

@brarcher brarcher Dec 13, 2016

Choose a reason for hiding this comment

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

I do not think you need the @item inside the @code{}. This may be what the build is complaining about when checking the documentation.

Copy link
Contributor Author

@9fcc 9fcc Dec 13, 2016

Choose a reason for hiding this comment

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

Sorry, I did it again. I would like to know how do I make such mistakes... Moreover, I've mixed up descriptions.

If checks in my commits fail, you can just wait until I fix everything. I make changes in a hurry, but I can fix them all only when I get home. So I see what's wrong but just can't send fixes.

@brarcher brarcher merged commit 75cec15 into libcheck:master Dec 14, 2016
@brarcher
Copy link
Contributor

Looks good. Thanks!

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