- assertTrue("Rotation " + testResults.get(x).getRotation() + " degrees: Too many images failed",
- passedCounts[x] >= testResults.get(x).getMustPassCount());
+ 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) + "%, " + totalMustPass + " required)");
+ if (totalFound > totalMustPass) {
+ System.out.println(" *** Test too lax by " + (totalFound - totalMustPass) + " images");
+ } else if (totalFound < totalMustPass) {
+ System.out.println(" *** Test failed by " + (totalMustPass - totalFound) + " images");
+ }
+
+ // Then run through again and assert if any failed
+ if (assertOnFailure) {
+ for (int x = 0; x < testCount; x++) {
+ assertTrue("Rotation " + testResults.get(x).getRotation() +
+ " degrees: Too many images failed",
+ passedCounts[x] >= testResults.get(x).getMustPassCount());
+ assertTrue("Try harder, Rotation " + testResults.get(x).getRotation() +
+ " degrees: Too many images failed",
+ tryHarderCounts[x] >= testResults.get(x).getTryHarderCount());
+ }