-----------------------------------------------*/
| 1378 | |
| 1379 | /*-----------------------------------------------*/ |
| 1380 | void UnityAssertNumbersWithin(const UNITY_UINT delta, |
| 1381 | const UNITY_INT expected, |
| 1382 | const UNITY_INT actual, |
| 1383 | const char* msg, |
| 1384 | const UNITY_LINE_TYPE lineNumber, |
| 1385 | const UNITY_DISPLAY_STYLE_T style) |
| 1386 | { |
| 1387 | RETURN_IF_FAIL_OR_IGNORE; |
| 1388 | |
| 1389 | if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) |
| 1390 | { |
| 1391 | if (actual > expected) |
| 1392 | { |
| 1393 | Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); |
| 1394 | } |
| 1395 | else |
| 1396 | { |
| 1397 | Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); |
| 1398 | } |
| 1399 | } |
| 1400 | else |
| 1401 | { |
| 1402 | if ((UNITY_UINT)actual > (UNITY_UINT)expected) |
| 1403 | { |
| 1404 | Unity.CurrentTestFailed = (((UNITY_UINT)actual - (UNITY_UINT)expected) > delta); |
| 1405 | } |
| 1406 | else |
| 1407 | { |
| 1408 | Unity.CurrentTestFailed = (((UNITY_UINT)expected - (UNITY_UINT)actual) > delta); |
| 1409 | } |
| 1410 | } |
| 1411 | |
| 1412 | if (Unity.CurrentTestFailed) |
| 1413 | { |
| 1414 | UnityTestResultsFailBegin(lineNumber); |
| 1415 | UnityPrint(UnityStrDelta); |
| 1416 | UnityPrintNumberByStyle((UNITY_INT)delta, style); |
| 1417 | UnityPrint(UnityStrExpected); |
| 1418 | UnityPrintNumberByStyle(expected, style); |
| 1419 | UnityPrint(UnityStrWas); |
| 1420 | UnityPrintNumberByStyle(actual, style); |
| 1421 | UnityAddMsgIfSpecified(msg); |
| 1422 | UNITY_FAIL_AND_BAIL; |
| 1423 | } |
| 1424 | } |
| 1425 | |
| 1426 | /*-----------------------------------------------*/ |
| 1427 | void UnityAssertNumbersArrayWithin(const UNITY_UINT delta, |
nothing calls this directly
no test coverage detected