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 a Unity macro to assert on platform error code difference #8646

Merged
merged 1 commit into from
Nov 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions features/frameworks/unity/unity/unity.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,15 @@ void tearDown(void);
#define TEST_ASSERT_DOUBLE_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, (message))
#define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, (message))


/*-------------------------------------------------------
* Error code checking
*-------------------------------------------------------*/
// Use these to check whether error code equals what we expect.
// Only display error code (without other information)
#define TEST_ASSERT_EQUAL_ERROR_CODE(expected, actual) TEST_ASSERT_EQUAL(MBED_GET_ERROR_CODE(expected), MBED_GET_ERROR_CODE(actual))
#define TEST_ASSERT_EQUAL_ERROR_CODE_MESSAGE(expected, actual, message) TEST_ASSERT_EQUAL_MESSAGE(MBED_GET_ERROR_CODE(expected), MBED_GET_ERROR_CODE(actual))

/*-------------------------------------------------------
* Test skipping
*-------------------------------------------------------*/
Expand Down