2 * Copyright 2008 ZXing authors
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package com.google.zxing.oned;
\r
19 import com.google.zxing.BarcodeFormat;
\r
20 import com.google.zxing.DecodeHintType;
\r
21 import com.google.zxing.MultiFormatReader;
\r
22 import com.google.zxing.common.AbstractBlackBoxTestCase;
\r
24 import java.util.Hashtable;
\r
25 import java.util.Vector;
\r
28 * @author kevin.osullivan@sita.aero
\r
30 public final class ITFBlackBox1TestCase extends AbstractBlackBoxTestCase {
\r
32 public ITFBlackBox1TestCase() {
\r
33 super("test/data/blackbox/itf-1", new MultiFormatReader(), BarcodeFormat.ITF);
\r
34 addTest(9, 12, 0.0f);
\r
37 // TODO(dswitkin): This is only used for the mean time because ITF is not turned on by default.
\r
38 // The other formats are included here to make sure we don't recognize an ITF barcode as something
\r
39 // else. Unfortunately this list is fragile. The right thing to do is profile ITF for performance,
\r
40 // and if it doesn't impose significant overhead, turn it on by default. Then this method can be
\r
41 // removed completely.
\r
43 protected Hashtable<DecodeHintType, Object> getHints() {
\r
44 Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(3);
\r
45 Vector<BarcodeFormat> vector = new Vector<BarcodeFormat>();
\r
46 vector.addElement(BarcodeFormat.UPC_A);
\r
47 vector.addElement(BarcodeFormat.UPC_E);
\r
48 vector.addElement(BarcodeFormat.EAN_13);
\r
49 vector.addElement(BarcodeFormat.EAN_8);
\r
50 vector.addElement(BarcodeFormat.CODE_39);
\r
51 vector.addElement(BarcodeFormat.CODE_128);
\r
52 vector.addElement(BarcodeFormat.ITF);
\r
53 vector.addElement(BarcodeFormat.QR_CODE);
\r
54 hints.put(DecodeHintType.POSSIBLE_FORMATS, vector);
\r