mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
test: update the format of TEST_ASSERT macro series in `unity.c
`
This commit is contained in:
parent
58a5d883f4
commit
7370f2913d
@ -438,6 +438,7 @@ static int UnityCheckArraysForNull(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_P
|
|||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UnityPrint(UnityStrNullPointerForExpected);
|
UnityPrint(UnityStrNullPointerForExpected);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,6 +448,7 @@ static int UnityCheckArraysForNull(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_P
|
|||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UnityPrint(UnityStrNullPointerForActual);
|
UnityPrint(UnityStrNullPointerForActual);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,6 +476,7 @@ void UnityAssertBits(const _U_SINT mask,
|
|||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintMask((_U_UINT)mask, (_U_UINT)actual);
|
UnityPrintMask((_U_UINT)mask, (_U_UINT)actual);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -495,6 +498,7 @@ void UnityAssertEqualNumber(const _U_SINT expected,
|
|||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(actual, style);
|
UnityPrintNumberByStyle(actual, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -504,6 +508,7 @@ void UnityAssertEqualNumber(const _U_SINT expected,
|
|||||||
UnityTestResultsFailBegin(lineNumber); \
|
UnityTestResultsFailBegin(lineNumber); \
|
||||||
UnityPrint(UnityStrPointless); \
|
UnityPrint(UnityStrPointless); \
|
||||||
UnityAddMsgIfSpecified(msg); \
|
UnityAddMsgIfSpecified(msg); \
|
||||||
|
UNITY_OUTPUT_CHAR('\n'); \
|
||||||
UNITY_FAIL_AND_BAIL; }
|
UNITY_FAIL_AND_BAIL; }
|
||||||
|
|
||||||
/*-----------------------------------------------*/
|
/*-----------------------------------------------*/
|
||||||
@ -548,6 +553,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 1);
|
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 1);
|
||||||
@ -569,6 +575,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_act, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US16*)ptr_act, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 2);
|
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 2);
|
||||||
@ -591,6 +598,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_act, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US64*)ptr_act, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 8);
|
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 8);
|
||||||
@ -611,6 +619,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
|
|||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_act, style);
|
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US32*)ptr_act, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 4);
|
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 4);
|
||||||
@ -667,6 +676,7 @@ void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
|
|||||||
UnityPrint(UnityStrDelta);
|
UnityPrint(UnityStrDelta);
|
||||||
#endif
|
#endif
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
ptr_expected++;
|
ptr_expected++;
|
||||||
@ -708,6 +718,7 @@ void UnityAssertFloatsWithin(const _UF delta,
|
|||||||
UnityPrint(UnityStrDelta);
|
UnityPrint(UnityStrDelta);
|
||||||
#endif
|
#endif
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -775,6 +786,7 @@ void UnityAssertFloatSpecial(const _UF actual,
|
|||||||
UnityPrint(trait_names[trait_index]);
|
UnityPrint(trait_names[trait_index]);
|
||||||
#endif
|
#endif
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -828,6 +840,7 @@ void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
|
|||||||
UnityPrint(UnityStrDelta);
|
UnityPrint(UnityStrDelta);
|
||||||
#endif
|
#endif
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
ptr_expected++;
|
ptr_expected++;
|
||||||
@ -869,6 +882,7 @@ void UnityAssertDoublesWithin(const _UD delta,
|
|||||||
UnityPrint(UnityStrDelta);
|
UnityPrint(UnityStrDelta);
|
||||||
#endif
|
#endif
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -937,6 +951,7 @@ void UnityAssertDoubleSpecial(const _UD actual,
|
|||||||
UnityPrint(trait_names[trait_index]);
|
UnityPrint(trait_names[trait_index]);
|
||||||
#endif
|
#endif
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -979,6 +994,7 @@ void UnityAssertNumbersWithin( const _U_UINT delta,
|
|||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(actual, style);
|
UnityPrintNumberByStyle(actual, style);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1018,6 +1034,7 @@ void UnityAssertEqualString(const char* expected,
|
|||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UnityPrintExpectedAndActualStrings(expected, actual);
|
UnityPrintExpectedAndActualStrings(expected, actual);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1058,6 +1075,7 @@ void UnityAssertEqualStringLen(const char* expected,
|
|||||||
UnityTestResultsFailBegin(lineNumber);
|
UnityTestResultsFailBegin(lineNumber);
|
||||||
UnityPrintExpectedAndActualStringsLen(expected, actual, length);
|
UnityPrintExpectedAndActualStringsLen(expected, actual, length);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1115,6 +1133,7 @@ void UnityAssertEqualStringArray( const char** expected,
|
|||||||
}
|
}
|
||||||
UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j]));
|
UnityPrintExpectedAndActualStrings((const char*)(expected[j]), (const char*)(actual[j]));
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
} while (++j < num_elements);
|
} while (++j < num_elements);
|
||||||
@ -1165,6 +1184,7 @@ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
|
|||||||
UnityPrint(UnityStrWas);
|
UnityPrint(UnityStrWas);
|
||||||
UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8);
|
UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8);
|
||||||
UnityAddMsgIfSpecified(msg);
|
UnityAddMsgIfSpecified(msg);
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 1);
|
ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 1);
|
||||||
@ -1208,7 +1228,7 @@ void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
|
|||||||
}
|
}
|
||||||
UnityPrint(msg);
|
UnityPrint(msg);
|
||||||
}
|
}
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_FAIL_AND_BAIL;
|
UNITY_FAIL_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1225,6 +1245,7 @@ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
|
|||||||
UNITY_OUTPUT_CHAR(' ');
|
UNITY_OUTPUT_CHAR(' ');
|
||||||
UnityPrint(msg);
|
UnityPrint(msg);
|
||||||
}
|
}
|
||||||
|
UNITY_OUTPUT_CHAR('\n');
|
||||||
UNITY_IGNORE_AND_BAIL;
|
UNITY_IGNORE_AND_BAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user