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

TEST_ASSERT_xyz_WITHIN_MESSAGE() doesn't print any message #7

Closed
alejmrm opened this issue Aug 28, 2012 · 1 comment
Closed

TEST_ASSERT_xyz_WITHIN_MESSAGE() doesn't print any message #7

alejmrm opened this issue Aug 28, 2012 · 1 comment

Comments

@alejmrm
Copy link
Contributor

alejmrm commented Aug 28, 2012

The reason that TEST_ASSERT_xyz_WITHIN_MESSAGE() family of functions doesn't print any message is because is calling a re-use macro from the TEST_ASSERT_xyz_WITHIN() family of functions. Let me explain:

TEST_ASSERT_INT_WITHIN() => calls => UNITY_TEST_ASSERT_INT_WITHIN()

TEST_ASSERT_INT_WITHIN_MESSAGE() => calls => UNITY_TEST_ASSERT_INT_WITHIN()

Due this two functions in unity.h calls the same function from unity_internals.h, the message is nullified at this point as follow:

UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message)                     UnityAssertNumbersWithin((_U_SINT)(delta), (_U_SINT)(expected), (_U_SINT)(actual), NULL, (UNITY_LINE_TYPE)line, UNITY_DISPLAY_STYLE_INT)

The issue is in the 4th argument of UnityAssertNumbersWithin() function that has a NULL.

alejmrm added a commit to alejmrm/Unity that referenced this issue Aug 28, 2012
The reason that TEST_ASSERT_xyz_WITHIN_MESSAGE() family of functions
doesn't print any message is because is calling a re-use macro from the
TEST_ASSERT_xyz_WITHIN() family of functions. Due this two functions in
unity.h calls the same function from unity_internals.h, the message is
nullified at this point. The issue is fix by passing _message_ arg to
the 4th argument of *UnityAssertNumbersWithin()* function.
barneywilliams pushed a commit that referenced this issue Sep 6, 2012
Fix issue #7 INTx_WITHIN_MESSAGE() macro
@alejmrm
Copy link
Contributor Author

alejmrm commented Sep 7, 2012

Fixed. Thank you for taking the pull request #8.

@alejmrm alejmrm closed this as completed Sep 7, 2012
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

1 participant