MCPcopy Index your code
hub / github.com/ThrowTheSwitch/Unity / UnityIsOneArrayNull

Function UnityIsOneArrayNull

src/unity.c:657–684  ·  view source on GitHub ↗

-----------------------------------------------*/

Source from the content-addressed store, hash-verified

655
656/*-----------------------------------------------*/
657static int UnityIsOneArrayNull(UNITY_INTERNAL_PTR expected,
658 UNITY_INTERNAL_PTR actual,
659 const UNITY_LINE_TYPE lineNumber,
660 const char* msg)
661{
662 /* Both are NULL or same pointer */
663 if (expected == actual) { return 0; }
664
665 /* print and return true if just expected is NULL */
666 if (expected == NULL)
667 {
668 UnityTestResultsFailBegin(lineNumber);
669 UnityPrint(UnityStrNullPointerForExpected);
670 UnityAddMsgIfSpecified(msg);
671 return 1;
672 }
673
674 /* print and return true if just actual is NULL */
675 if (actual == NULL)
676 {
677 UnityTestResultsFailBegin(lineNumber);
678 UnityPrint(UnityStrNullPointerForActual);
679 UnityAddMsgIfSpecified(msg);
680 return 1;
681 }
682
683 return 0; /* return false if neither is NULL */
684}
685
686/*-----------------------------------------------
687 * Assertion Functions

Callers 6

UnityAssertEqualIntArrayFunction · 0.85
UnityAssertEqualMemoryFunction · 0.85

Calls 3

UnityPrintFunction · 0.85
UnityAddMsgIfSpecifiedFunction · 0.85

Tested by

no test coverage detected