Merge pull request #241 from jsalling/cleanup/float-testing

Cleanup floating point print testing, update docs
This commit is contained in:
Mark VanderVoord
2017-01-13 15:42:15 -05:00
committed by GitHub
4 changed files with 35 additions and 57 deletions

View File

@ -642,6 +642,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
}
/*-----------------------------------------------*/
#ifndef UNITY_EXCLUDE_FLOAT
/* Wrap this define in a function with variable types as float or double */
#define UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff) \
if (isinf(expected) && isinf(actual) && (isneg(expected) == isneg(actual))) return 1; \
@ -670,7 +671,6 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
UnityPrint(UnityStrDelta)
#endif /* UNITY_EXCLUDE_FLOAT_PRINT */
#ifndef UNITY_EXCLUDE_FLOAT
static int UnityFloatsWithin(UNITY_FLOAT delta, UNITY_FLOAT expected, UNITY_FLOAT actual)
{
UNITY_FLOAT diff;