From 25e9af9edd9ec1776c664022eef9353e279e5137 Mon Sep 17 00:00:00 2001 From: ml-physec <206103694+ml-physec@users.noreply.github.com> Date: Thu, 7 Aug 2025 13:44:02 +0200 Subject: [PATCH] Update detail-stack implementation after #784 --- examples/example_5/test/TestProductionCode.c | 2 +- src/unity.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/example_5/test/TestProductionCode.c b/examples/example_5/test/TestProductionCode.c index 38692ad5..ab3d3e29 100644 --- a/examples/example_5/test/TestProductionCode.c +++ b/examples/example_5/test/TestProductionCode.c @@ -33,7 +33,7 @@ void test_BitExtractor(void) { const test_vector_t test_vectors[] = { {__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} }; const test_vector_t* tv; diff --git a/src/unity.c b/src/unity.c index c22bdae3..3ea455d0 100644 --- a/src/unity.c +++ b/src/unity.c @@ -601,7 +601,11 @@ static void UnityAddMsgIfSpecified(const char* msg) if ((label[0] == '#') && (label[1] != 0)) { UnityPrint(label + 2); 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){ UnityPrint(label); UNITY_OUTPUT_CHAR(' ');