Skip to content

Commit 0d7ea70

Browse files
authored
Merge pull request #798 from ml-physec/fix-details-print
Update detail-stack implementation after #784
2 parents bddb136 + 25e9af9 commit 0d7ea70

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/example_5/test/TestProductionCode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void test_BitExtractor(void)
3333
{
3434
const test_vector_t test_vectors[] = {
3535
{__LINE__, 7, BIT_DIRECTION_UP, {1,1,1,0,0,0,0,0}},
36-
{__LINE__, 7, BIT_DIRECTION_DOWN, {0,0,0,0,0,1,0,1}},
36+
{__LINE__, 7, BIT_DIRECTION_DOWN, {0,0,0,0,0,1,0,1}}, /* intentionally wrong to demonstrate detail output */
3737
{0}
3838
};
3939
const test_vector_t* tv;

src/unity.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,11 @@ static void UnityAddMsgIfSpecified(const char* msg)
601601
if ((label[0] == '#') && (label[1] != 0)) {
602602
UnityPrint(label + 2);
603603
UNITY_OUTPUT_CHAR(' ');
604-
UnityPrintNumberByStyle(Unity.CurrentDetailStackValues[c], label[1]);
604+
if ((label[1] & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) {
605+
UnityPrintIntNumberByStyle((UNITY_INT)Unity.CurrentDetailStackValues[c], label[1]);
606+
} else {
607+
UnityPrintUintNumberByStyle((UNITY_UINT)Unity.CurrentDetailStackValues[c], label[1]);
608+
}
605609
} else if (Unity.CurrentDetailStackValues[c] != 0){
606610
UnityPrint(label);
607611
UNITY_OUTPUT_CHAR(' ');

0 commit comments

Comments
 (0)