From ae1bcc5cb291593fac3fdcdcb68f336869cb54aa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Aug 2020 16:16:45 +0200 Subject: [PATCH] Show only the first difference when images differ in the tests The code was supposed to do this, but didn't, as "break" only broke from the inner loop, but not the outer one, so replace it with "return". --- tests/testimage.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/testimage.h b/tests/testimage.h index bf14988116..e922e36d63 100644 --- a/tests/testimage.h +++ b/tests/testimage.h @@ -62,7 +62,9 @@ public: "expected 0x%06x", x, y, *d2, *d1 ); - break; + + // Don't show all mismatches, there may be too many of them. + return false; } ++d1; @@ -70,6 +72,10 @@ public: } } + // We should never get here as we know that the images are different + // and so should have returned from inside the loop above. + wxFAIL_MSG("unreachable"); + return false; }