mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-26 18:01:35 +01:00
Finished fixing floating point comparisons. We have streamlined how floats and doubles are checked, but we still can't compare them for equality directly. So we're directly testing for infinite and NaN before checking diffs. Also, we've officially decided that for testing purposes NaN shall equal NaN, +Inf shall equal +Inf, and -Inf shall equal -Inf. It's what most people expect during a test.
This commit is contained in:
@@ -18,20 +18,26 @@ void putcharSpy(int c) { (void)putchar(c);} // include passthrough for linking t
|
||||
|
||||
#define VERIFY_FAILS_END \
|
||||
} \
|
||||
Unity.CurrentTestFailed = (Unity.CurrentTestFailed == 1) ? 0 : 1; \
|
||||
Unity.CurrentTestFailed = (Unity.CurrentTestFailed != 0) ? 0 : 1; \
|
||||
if (Unity.CurrentTestFailed == 1) { \
|
||||
SetToOneMeanWeAlreadyCheckedThisGuy = 1; \
|
||||
UnityPrint("[[[[ Previous Test Should Have Failed But Did Not ]]]]"); \
|
||||
UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \
|
||||
UNITY_OUTPUT_CHAR(':'); \
|
||||
UnityPrint(Unity.CurrentTestName); \
|
||||
UnityPrint(":FAIL: [[[[ Test Should Have Failed But Did Not ]]]]"); \
|
||||
UNITY_OUTPUT_CHAR('\n'); \
|
||||
}
|
||||
|
||||
#define VERIFY_IGNORES_END \
|
||||
} \
|
||||
Unity.CurrentTestFailed = (Unity.CurrentTestIgnored == 1) ? 0 : 1; \
|
||||
Unity.CurrentTestFailed = (Unity.CurrentTestIgnored != 0) ? 0 : 1; \
|
||||
Unity.CurrentTestIgnored = 0; \
|
||||
if (Unity.CurrentTestFailed == 1) { \
|
||||
SetToOneMeanWeAlreadyCheckedThisGuy = 1; \
|
||||
UnityPrint("[[[[ Previous Test Should Have Ignored But Did Not ]]]]"); \
|
||||
UnityPrintNumberUnsigned(Unity.CurrentTestLineNumber); \
|
||||
UNITY_OUTPUT_CHAR(':'); \
|
||||
UnityPrint(Unity.CurrentTestName); \
|
||||
UnityPrint(":FAIL: [[[[ Test Should Have Ignored But Did Not ]]]]"); \
|
||||
UNITY_OUTPUT_CHAR('\n'); \
|
||||
}
|
||||
|
||||
@@ -50,7 +56,7 @@ void tearDown(void)
|
||||
TEST_FAIL_MESSAGE("<= Failed in tearDown");
|
||||
if ((SetToOneMeanWeAlreadyCheckedThisGuy == 0) && (Unity.CurrentTestFailed > 0))
|
||||
{
|
||||
UnityPrint("[[[[ Previous Test Should Have Passed But Did Not ]]]]");
|
||||
UnityPrint(": [[[[ Test Should Have Passed But Did Not ]]]]");
|
||||
UNITY_OUTPUT_CHAR('\n');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user