Only show call count warning when counts don’t match

This commit is contained in:
Marijn van der Werf 2016-09-03 13:40:22 +02:00
parent ee61a6af12
commit fe0de811f1
1 changed files with 7 additions and 1 deletions

View File

@ -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);