X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=core%2Ftest%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fcommon%2FAbstractBlackBoxTestCase.java;fp=core%2Ftest%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fcommon%2FAbstractBlackBoxTestCase.java;h=9e3ccde915c1e1488629771a143ab9f20c17a218;hb=7e271e44cbc65241a9dc73e47d6acf6f7e5ef150;hp=9d4017ead94901fe438559aba8dbfd11aa04eb92;hpb=d751a2d35baf9daf39c5e6532b0b13432a442f10;p=zxing.git diff --git a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java index 9d4017ea..9e3ccde9 100644 --- a/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java +++ b/core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java @@ -115,6 +115,10 @@ public abstract class AbstractBlackBoxTestCase extends TestCase { return barcodeReader; } + protected Hashtable getHints() { + return null; + } + public void testBlackBox() throws IOException { assertFalse(testResults.isEmpty()); @@ -172,7 +176,15 @@ public abstract class AbstractBlackBoxTestCase extends TestCase { String suffix = " (" + (tryHarder ? "try harder, " : "") + "rotation: " + rotation + ')'; try { - result = barcodeReader.decode(source, tryHarder ? TRY_HARDER_HINT : null); + Hashtable hints = getHints(); + if (tryHarder) { + if (hints == null) { + hints = TRY_HARDER_HINT; + } else { + hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE); + } + } + result = getReader().decode(source, hints); } catch (ReaderException re) { System.out.println(re + suffix); return false;