- Added a new unit test of 13 ITF images I took with a T-Mobile G1.
authordswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 9 Mar 2009 20:48:48 +0000 (20:48 +0000)
committerdswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 9 Mar 2009 20:48:48 +0000 (20:48 +0000)
- Added upside down unit tests for the existing ITF images.
- Removed the temporary format code from these tests now that ITF is on by default.

git-svn-id: http://zxing.googlecode.com/svn/trunk@883 59b500cc-1b3d-0410-9834-0bbf25fbcc57

28 files changed:
core/test/data/blackbox/itf-2/01.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/01.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/02.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/02.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/03.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/03.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/04.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/04.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/05.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/05.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/06.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/06.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/07.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/07.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/08.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/08.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/09.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/09.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/10.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/10.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/11.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/11.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/12.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/12.txt [new file with mode: 0644]
core/test/data/blackbox/itf-2/13.jpg [new file with mode: 0755]
core/test/data/blackbox/itf-2/13.txt [new file with mode: 0644]
core/test/src/com/google/zxing/oned/ITFBlackBox1TestCase.java
core/test/src/com/google/zxing/oned/ITFBlackBox2TestCase.java [new file with mode: 0644]

diff --git a/core/test/data/blackbox/itf-2/01.jpg b/core/test/data/blackbox/itf-2/01.jpg
new file mode 100755 (executable)
index 0000000..c1161d0
Binary files /dev/null and b/core/test/data/blackbox/itf-2/01.jpg differ
diff --git a/core/test/data/blackbox/itf-2/01.txt b/core/test/data/blackbox/itf-2/01.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/02.jpg b/core/test/data/blackbox/itf-2/02.jpg
new file mode 100755 (executable)
index 0000000..c092b7e
Binary files /dev/null and b/core/test/data/blackbox/itf-2/02.jpg differ
diff --git a/core/test/data/blackbox/itf-2/02.txt b/core/test/data/blackbox/itf-2/02.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/03.jpg b/core/test/data/blackbox/itf-2/03.jpg
new file mode 100755 (executable)
index 0000000..c4c03f9
Binary files /dev/null and b/core/test/data/blackbox/itf-2/03.jpg differ
diff --git a/core/test/data/blackbox/itf-2/03.txt b/core/test/data/blackbox/itf-2/03.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/04.jpg b/core/test/data/blackbox/itf-2/04.jpg
new file mode 100755 (executable)
index 0000000..2e46ce1
Binary files /dev/null and b/core/test/data/blackbox/itf-2/04.jpg differ
diff --git a/core/test/data/blackbox/itf-2/04.txt b/core/test/data/blackbox/itf-2/04.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/05.jpg b/core/test/data/blackbox/itf-2/05.jpg
new file mode 100755 (executable)
index 0000000..de16bd9
Binary files /dev/null and b/core/test/data/blackbox/itf-2/05.jpg differ
diff --git a/core/test/data/blackbox/itf-2/05.txt b/core/test/data/blackbox/itf-2/05.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/06.jpg b/core/test/data/blackbox/itf-2/06.jpg
new file mode 100755 (executable)
index 0000000..9a6113d
Binary files /dev/null and b/core/test/data/blackbox/itf-2/06.jpg differ
diff --git a/core/test/data/blackbox/itf-2/06.txt b/core/test/data/blackbox/itf-2/06.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/07.jpg b/core/test/data/blackbox/itf-2/07.jpg
new file mode 100755 (executable)
index 0000000..4727c79
Binary files /dev/null and b/core/test/data/blackbox/itf-2/07.jpg differ
diff --git a/core/test/data/blackbox/itf-2/07.txt b/core/test/data/blackbox/itf-2/07.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/08.jpg b/core/test/data/blackbox/itf-2/08.jpg
new file mode 100755 (executable)
index 0000000..e33d637
Binary files /dev/null and b/core/test/data/blackbox/itf-2/08.jpg differ
diff --git a/core/test/data/blackbox/itf-2/08.txt b/core/test/data/blackbox/itf-2/08.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/09.jpg b/core/test/data/blackbox/itf-2/09.jpg
new file mode 100755 (executable)
index 0000000..7b4aa47
Binary files /dev/null and b/core/test/data/blackbox/itf-2/09.jpg differ
diff --git a/core/test/data/blackbox/itf-2/09.txt b/core/test/data/blackbox/itf-2/09.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/10.jpg b/core/test/data/blackbox/itf-2/10.jpg
new file mode 100755 (executable)
index 0000000..74ca3b5
Binary files /dev/null and b/core/test/data/blackbox/itf-2/10.jpg differ
diff --git a/core/test/data/blackbox/itf-2/10.txt b/core/test/data/blackbox/itf-2/10.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/11.jpg b/core/test/data/blackbox/itf-2/11.jpg
new file mode 100755 (executable)
index 0000000..64f6c01
Binary files /dev/null and b/core/test/data/blackbox/itf-2/11.jpg differ
diff --git a/core/test/data/blackbox/itf-2/11.txt b/core/test/data/blackbox/itf-2/11.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/12.jpg b/core/test/data/blackbox/itf-2/12.jpg
new file mode 100755 (executable)
index 0000000..4c32edf
Binary files /dev/null and b/core/test/data/blackbox/itf-2/12.jpg differ
diff --git a/core/test/data/blackbox/itf-2/12.txt b/core/test/data/blackbox/itf-2/12.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
diff --git a/core/test/data/blackbox/itf-2/13.jpg b/core/test/data/blackbox/itf-2/13.jpg
new file mode 100755 (executable)
index 0000000..caa0600
Binary files /dev/null and b/core/test/data/blackbox/itf-2/13.jpg differ
diff --git a/core/test/data/blackbox/itf-2/13.txt b/core/test/data/blackbox/itf-2/13.txt
new file mode 100644 (file)
index 0000000..a8fb53d
--- /dev/null
@@ -0,0 +1 @@
+070429
\ No newline at end of file
index 28d81f0..ad488dc 100644 (file)
 package com.google.zxing.oned;\r
 \r
 import com.google.zxing.BarcodeFormat;\r
-import com.google.zxing.DecodeHintType;\r
 import com.google.zxing.MultiFormatReader;\r
 import com.google.zxing.common.AbstractBlackBoxTestCase;\r
 \r
-import java.util.Hashtable;\r
-import java.util.Vector;\r
-\r
 /**\r
  * @author kevin.osullivan@sita.aero\r
  */\r
@@ -32,27 +28,7 @@ public final class ITFBlackBox1TestCase extends AbstractBlackBoxTestCase {
   public ITFBlackBox1TestCase() {\r
     super("test/data/blackbox/itf-1", new MultiFormatReader(), BarcodeFormat.ITF);\r
     addTest(9, 12, 0.0f);\r
-  }\r
-\r
-  // TODO(dswitkin): This is only used for the mean time because ITF is not turned on by default.\r
-  // The other formats are included here to make sure we don't recognize an ITF barcode as something\r
-  // else. Unfortunately this list is fragile. The right thing to do is profile ITF for performance,\r
-  // and if it doesn't impose significant overhead, turn it on by default. Then this method can be\r
-  // removed completely.\r
-  @Override\r
-  protected Hashtable<DecodeHintType, Object> getHints() {\r
-    Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(3);\r
-    Vector<BarcodeFormat> vector = new Vector<BarcodeFormat>();\r
-    vector.addElement(BarcodeFormat.UPC_A);\r
-    vector.addElement(BarcodeFormat.UPC_E);\r
-    vector.addElement(BarcodeFormat.EAN_13);\r
-    vector.addElement(BarcodeFormat.EAN_8);\r
-    vector.addElement(BarcodeFormat.CODE_39);\r
-    vector.addElement(BarcodeFormat.CODE_128);\r
-    vector.addElement(BarcodeFormat.ITF);\r
-    vector.addElement(BarcodeFormat.QR_CODE);\r
-    hints.put(DecodeHintType.POSSIBLE_FORMATS, vector);\r
-    return hints;\r
+    addTest(8, 12, 180.0f);\r
   }\r
 \r
 }\r
diff --git a/core/test/src/com/google/zxing/oned/ITFBlackBox2TestCase.java b/core/test/src/com/google/zxing/oned/ITFBlackBox2TestCase.java
new file mode 100644 (file)
index 0000000..72f321c
--- /dev/null
@@ -0,0 +1,34 @@
+/*\r
+ * Copyright 2008 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package com.google.zxing.oned;\r
+\r
+import com.google.zxing.BarcodeFormat;\r
+import com.google.zxing.MultiFormatReader;\r
+import com.google.zxing.common.AbstractBlackBoxTestCase;\r
+\r
+/**\r
+ * @author dswitkin@google.com (Daniel Switkin)\r
+ */\r
+public final class ITFBlackBox2TestCase extends AbstractBlackBoxTestCase {\r
+\r
+  public ITFBlackBox2TestCase() {\r
+    super("test/data/blackbox/itf-2", new MultiFormatReader(), BarcodeFormat.ITF);\r
+    addTest(8, 9, 0.0f);\r
+    addTest(8, 9, 180.0f);\r
+  }\r
+\r
+}\r