From fe0de811f1128e89dabc0c59819c5fc282e06c23 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 3 Sep 2016 13:40:22 +0200 Subject: [PATCH] =?UTF-8?q?Only=20show=20call=20count=20warning=20when=20c?= =?UTF-8?q?ounts=20don=E2=80=99t=20match?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PaintTest/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PaintTest/main.c b/PaintTest/main.c index 67c3a9faa9..86da168469 100644 --- a/PaintTest/main.c +++ b/PaintTest/main.c @@ -569,7 +569,13 @@ bool testTrackElement(uint8 rideType, uint8 trackType, utf8string *error) { sprintf(diff + strlen(diff), "====\n"); printFunctionCallArray(&diff, newCalls, newCallCount); sprintf(diff + strlen(diff), ">>> ACTUAL\n"); - sprintf(*error, "Call counts don't match (was %d, expected %d) [direction:%d trackSequence:%d]", newCallCount, oldCallCount, direction, trackSequence); + + if (oldCallCount != newCallCount) { + sprintf(*error, "Call counts don't match (was %d, expected %d) [direction:%d trackSequence:%d]", newCallCount, oldCallCount, direction, trackSequence); + } else { + sprintf(*error, "Calls don't match [direction:%d trackSequence:%d]", direction, trackSequence); + } + sprintf(*error + strlen(*error), "\n%s", diff); free(diff);