-----------------------------------------------*/
| 963 | |
| 964 | /*-----------------------------------------------*/ |
| 965 | void UnityAssertNumbersWithin(const UNITY_UINT delta, |
| 966 | const UNITY_INT expected, |
| 967 | const UNITY_INT actual, |
| 968 | const char* msg, |
| 969 | const UNITY_LINE_TYPE lineNumber, |
| 970 | const UNITY_DISPLAY_STYLE_T style) |
| 971 | { |
| 972 | RETURN_IF_FAIL_OR_IGNORE; |
| 973 | |
| 974 | if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) |
| 975 | { |
| 976 | if (actual > expected) |
| 977 | Unity.CurrentTestFailed = (UNITY_UINT)((UNITY_UINT)(actual - expected) > delta); |
| 978 | else |
| 979 | Unity.CurrentTestFailed = (UNITY_UINT)((UNITY_UINT)(expected - actual) > delta); |
| 980 | } |
| 981 | else |
| 982 | { |
| 983 | if ((UNITY_UINT)actual > (UNITY_UINT)expected) |
| 984 | Unity.CurrentTestFailed = (UNITY_UINT)((UNITY_UINT)(actual - expected) > delta); |
| 985 | else |
| 986 | Unity.CurrentTestFailed = (UNITY_UINT)((UNITY_UINT)(expected - actual) > delta); |
| 987 | } |
| 988 | |
| 989 | if (Unity.CurrentTestFailed) |
| 990 | { |
| 991 | UnityTestResultsFailBegin(lineNumber); |
| 992 | UnityPrint(UnityStrDelta); |
| 993 | UnityPrintNumberByStyle((UNITY_INT)delta, style); |
| 994 | UnityPrint(UnityStrExpected); |
| 995 | UnityPrintNumberByStyle(expected, style); |
| 996 | UnityPrint(UnityStrWas); |
| 997 | UnityPrintNumberByStyle(actual, style); |
| 998 | UnityAddMsgIfSpecified(msg); |
| 999 | UNITY_FAIL_AND_BAIL; |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | /*-----------------------------------------------*/ |
| 1004 | void UnityAssertEqualString(const char* expected, |
nothing calls this directly
no test coverage detected
searching dependent graphs…