From 86b0d628fd701a48a2f85bfce93b3b9eacbadddd Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Thu, 10 Dec 2015 18:42:45 -0500 Subject: [PATCH] - Applied details to FAIL messages as well --- src/unity.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/unity.c b/src/unity.c index 08db2a8..86ce795 100644 --- a/src/unity.c +++ b/src/unity.c @@ -1210,13 +1210,28 @@ void UnityFail(const char* msg, const UNITY_LINE_TYPE line) UnityPrintFail(); if (msg != NULL) { - UNITY_OUTPUT_CHAR(':'); - if (msg[0] != ' ') - { - UNITY_OUTPUT_CHAR(' '); - } - UnityPrint(msg); + UNITY_OUTPUT_CHAR(':'); + +#ifndef UNITY_EXCLUDE_DETAILS + if (Unity.CurrentDetail1) + { + UnityPrint(UnityStrDetail1Name); + UnityPrint(Unity.CurrentDetail1); + if (Unity.CurrentDetail2) + { + UnityPrint(UnityStrDetail2Name); + UnityPrint(Unity.CurrentDetail2); + } + UnityPrint(UnityStrSpacer); + } +#endif + if (msg[0] != ' ') + { + UNITY_OUTPUT_CHAR(' '); + } + UnityPrint(msg); } + UNITY_FAIL_AND_BAIL; }