From 2d7e0c04a77045a64400ee2d4ca952649f9806a0 Mon Sep 17 00:00:00 2001 From: dswitkin Date: Thu, 21 May 2009 21:18:27 +0000 Subject: [PATCH] Added better logging for our blackbox tests. It now displays the number of images which passes per test out of the total, and the percentage. It also warns when a blackbox test is too lax (i.e. we've made decoding improvements but haven't raised the high water mark). git-svn-id: http://zxing.googlecode.com/svn/trunk@947 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../zxing/common/AbstractBlackBoxTestCase.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java index 16dc1bbd..fec39a0b 100644 --- a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java +++ b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java @@ -156,6 +156,8 @@ public abstract class AbstractBlackBoxTestCase extends TestCase { } // Print the results of all tests first + int totalFound = 0; + int totalMustPass = 0; for (int x = 0; x < testCount; x++) { System.out.println("Rotation " + testResults.get(x).getRotation() + " degrees:"); System.out.println(" " + passedCounts[x] + " of " + imageFiles.length + " images passed (" @@ -163,6 +165,17 @@ public abstract class AbstractBlackBoxTestCase extends TestCase { System.out.println(" " + tryHarderCounts[x] + " of " + imageFiles.length + " images passed with try harder (" + testResults.get(x).getTryHarderCount() + " required)"); + totalFound += passedCounts[x]; + totalFound += tryHarderCounts[x]; + totalMustPass += testResults.get(x).getMustPassCount(); + totalMustPass += testResults.get(x).getTryHarderCount(); + } + + int totalTests = imageFiles.length * testCount * 2; + System.out.println("TOTALS:\n Decoded " + totalFound + " images out of " + totalTests + + " (" + (totalFound * 100 / totalTests) + "%)"); + if (totalFound > totalMustPass) { + System.out.println(" *** Test too lax by " + (totalFound - totalMustPass) + " images"); } // Then run through again and assert if any failed -- 2.20.1