File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -619,12 +619,17 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
619619/* Wrap this define in a function with variable types as float or double */
620620#define UNITY_FLOAT_OR_DOUBLE_WITHIN (delta , expected , actual , diff ) \
621621 if (isinf(expected) && isinf(actual) && (isneg(expected) == isneg(actual))) return 1; \
622- if (isnan(expected) && isnan(actual)) return 1; \
622+ if (UNITY_NAN_CHECK) return 1; \
623623 diff = actual - expected; \
624624 if (diff < 0.0f) diff = 0.0f - diff; \
625625 if (delta < 0.0f) delta = 0.0f - delta; \
626- return !(isnan(diff) || isinf(diff) || (delta < diff));
626+ return !(isnan(diff) || isinf(diff) || (diff > delta))
627627 /* This first part of this condition will catch any NaN or Infinite values */
628+ #ifndef UNITY_NAN_NOT_EQUAL_NAN
629+ #define UNITY_NAN_CHECK isnan(expected) && isnan(actual)
630+ #else
631+ #define UNITY_NAN_CHECK 0
632+ #endif
628633
629634#ifndef UNITY_EXCLUDE_FLOAT
630635static int UnityFloatsWithin (_UF delta , _UF expected , _UF actual )
Original file line number Diff line number Diff line change @@ -3713,7 +3713,7 @@ void testNotEqualDoubleArraysNegative3(void)
37133713#endif
37143714}
37153715
3716- void testNotEqualDoubleArraysNaN (void )
3716+ void testEqualDoubleArraysNaN (void )
37173717{
37183718#ifdef UNITY_EXCLUDE_DOUBLE
37193719 TEST_IGNORE ();
You can’t perform that action at this time.
0 commit comments