Merge pull request #798 from ml-physec/fix-details-print

Update detail-stack implementation after #784
This commit is contained in:
Mark VanderVoord
2025-08-07 09:51:31 -04:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ void test_BitExtractor(void)
{ {
const test_vector_t test_vectors[] = { const test_vector_t test_vectors[] = {
{__LINE__, 7, BIT_DIRECTION_UP, {1,1,1,0,0,0,0,0}}, {__LINE__, 7, BIT_DIRECTION_UP, {1,1,1,0,0,0,0,0}},
{__LINE__, 7, BIT_DIRECTION_DOWN, {0,0,0,0,0,1,0,1}}, {__LINE__, 7, BIT_DIRECTION_DOWN, {0,0,0,0,0,1,0,1}}, /* intentionally wrong to demonstrate detail output */
{0} {0}
}; };
const test_vector_t* tv; const test_vector_t* tv;

View File

@@ -601,7 +601,11 @@ static void UnityAddMsgIfSpecified(const char* msg)
if ((label[0] == '#') && (label[1] != 0)) { if ((label[0] == '#') && (label[1] != 0)) {
UnityPrint(label + 2); UnityPrint(label + 2);
UNITY_OUTPUT_CHAR(' '); UNITY_OUTPUT_CHAR(' ');
UnityPrintNumberByStyle(Unity.CurrentDetailStackValues[c], label[1]); if ((label[1] & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) {
UnityPrintIntNumberByStyle((UNITY_INT)Unity.CurrentDetailStackValues[c], label[1]);
} else {
UnityPrintUintNumberByStyle((UNITY_UINT)Unity.CurrentDetailStackValues[c], label[1]);
}
} else if (Unity.CurrentDetailStackValues[c] != 0){ } else if (Unity.CurrentDetailStackValues[c] != 0){
UnityPrint(label); UnityPrint(label);
UNITY_OUTPUT_CHAR(' '); UNITY_OUTPUT_CHAR(' ');