Fix a nagging inconvenience from my IDE in running tests, due to working directory...
[zxing.git] / core / test / src / com / google / zxing / oned / ITFBlackBox1TestCase.java
1 /*\r
2  * Copyright 2008 ZXing authors\r
3  *\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
7  *\r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *\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
15  */\r
16 \r
17 package com.google.zxing.oned;\r
18 \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
23 \r
24 import java.util.Hashtable;\r
25 import java.util.Vector;\r
26 \r
27 /**\r
28  * @author kevin.osullivan@sita.aero\r
29  */\r
30 public final class ITFBlackBox1TestCase extends AbstractBlackBoxTestCase {\r
31 \r
32   public ITFBlackBox1TestCase() {\r
33     super("test/data/blackbox/itf-1", new MultiFormatReader(), BarcodeFormat.ITF);\r
34     addTest(9, 12, 0.0f);\r
35   }\r
36 \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
42   @Override\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
55     return hints;\r
56   }\r
57 \r
58 }\r