| 840 | } |
| 841 | |
| 842 | void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected, |
| 843 | UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual, |
| 844 | const UNITY_UINT32 num_elements, |
| 845 | const char* msg, |
| 846 | const UNITY_LINE_TYPE lineNumber, |
| 847 | const UNITY_FLAGS_T flags) |
| 848 | { |
| 849 | UNITY_UINT32 elements = num_elements; |
| 850 | UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_expected = expected; |
| 851 | UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_actual = actual; |
| 852 | |
| 853 | RETURN_IF_FAIL_OR_IGNORE; |
| 854 | |
| 855 | if (elements == 0) |
| 856 | { |
| 857 | UnityPrintPointlessAndBail(); |
| 858 | } |
| 859 | |
| 860 | if (expected == actual) return; /* Both are NULL or same pointer */ |
| 861 | if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) |
| 862 | UNITY_FAIL_AND_BAIL; |
| 863 | |
| 864 | while (elements--) |
| 865 | { |
| 866 | if (!UnityDoublesWithin(*ptr_expected * UNITY_DOUBLE_PRECISION, *ptr_expected, *ptr_actual)) |
| 867 | { |
| 868 | UnityTestResultsFailBegin(lineNumber); |
| 869 | UnityPrint(UnityStrElement); |
| 870 | UnityPrintNumberUnsigned(num_elements - elements - 1); |
| 871 | UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(*ptr_expected, *ptr_actual); |
| 872 | UnityAddMsgIfSpecified(msg); |
| 873 | UNITY_FAIL_AND_BAIL; |
| 874 | } |
| 875 | if (flags == UNITY_ARRAY_TO_ARRAY) |
| 876 | { |
| 877 | ptr_expected++; |
| 878 | } |
| 879 | ptr_actual++; |
| 880 | } |
| 881 | } |
| 882 | |
| 883 | /*-----------------------------------------------*/ |
| 884 | void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, |
nothing calls this directly
no test coverage detected
searching dependent graphs…