Adding delta infinity & nan checks & tests

This commit is contained in:
AJIOB
2022-11-28 20:23:36 +03:00
parent 0963e20d0b
commit b2360fa7ca
3 changed files with 54 additions and 0 deletions

View File

@@ -954,6 +954,17 @@ void UnityAssertWithinFloatArray(const UNITY_FLOAT delta,
#endif
}
if (isinf(in_delta))
{
return; /* Arrays will be force equal with infinite delta */
}
if (isnan(in_delta))
{
/* Delta must be correct number */
UnityPrintPointlessAndBail();
}
if (expected == actual)
{
return; /* Both are NULL or same pointer */
@@ -1170,6 +1181,17 @@ void UnityAssertWithinDoubleArray(const UNITY_DOUBLE delta,
#endif
}
if (isinf(in_delta))
{
return; /* Arrays will be force equal with infinite delta */
}
if (isnan(in_delta))
{
/* Delta must be correct number */
UnityPrintPointlessAndBail();
}
if (expected == actual)
{
return; /* Both are NULL or same pointer */