Added new test of unsupported barcodes, to make sure we don't decode them.
authordswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Wed, 25 Jun 2008 01:26:22 +0000 (01:26 +0000)
committerdswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Wed, 25 Jun 2008 01:26:22 +0000 (01:26 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@477 59b500cc-1b3d-0410-9834-0bbf25fbcc57

12 files changed:
core/test/data/blackbox/unsupported/01.jpg [new file with mode: 0644]
core/test/data/blackbox/unsupported/02.jpg [new file with mode: 0644]
core/test/data/blackbox/unsupported/03.jpg [new file with mode: 0755]
core/test/data/blackbox/unsupported/04.jpg [new file with mode: 0755]
core/test/data/blackbox/unsupported/05.jpg [new file with mode: 0755]
core/test/data/blackbox/unsupported/06.jpg [new file with mode: 0755]
core/test/data/blackbox/unsupported/07.jpg [new file with mode: 0755]
core/test/data/blackbox/unsupported/08.jpg [new file with mode: 0755]
core/test/data/blackbox/unsupported/09.jpg [new file with mode: 0755]
core/test/data/blackbox/unsupported/10.jpg [new file with mode: 0755]
core/test/src/com/google/zxing/negative/PartialBlackBoxTestCase.java
core/test/src/com/google/zxing/negative/UnsupportedBlackBoxTestCase.java [new file with mode: 0644]

diff --git a/core/test/data/blackbox/unsupported/01.jpg b/core/test/data/blackbox/unsupported/01.jpg
new file mode 100644 (file)
index 0000000..65cc1e2
Binary files /dev/null and b/core/test/data/blackbox/unsupported/01.jpg differ
diff --git a/core/test/data/blackbox/unsupported/02.jpg b/core/test/data/blackbox/unsupported/02.jpg
new file mode 100644 (file)
index 0000000..32cd980
Binary files /dev/null and b/core/test/data/blackbox/unsupported/02.jpg differ
diff --git a/core/test/data/blackbox/unsupported/03.jpg b/core/test/data/blackbox/unsupported/03.jpg
new file mode 100755 (executable)
index 0000000..2891b98
Binary files /dev/null and b/core/test/data/blackbox/unsupported/03.jpg differ
diff --git a/core/test/data/blackbox/unsupported/04.jpg b/core/test/data/blackbox/unsupported/04.jpg
new file mode 100755 (executable)
index 0000000..79ddd01
Binary files /dev/null and b/core/test/data/blackbox/unsupported/04.jpg differ
diff --git a/core/test/data/blackbox/unsupported/05.jpg b/core/test/data/blackbox/unsupported/05.jpg
new file mode 100755 (executable)
index 0000000..872603f
Binary files /dev/null and b/core/test/data/blackbox/unsupported/05.jpg differ
diff --git a/core/test/data/blackbox/unsupported/06.jpg b/core/test/data/blackbox/unsupported/06.jpg
new file mode 100755 (executable)
index 0000000..8520e7d
Binary files /dev/null and b/core/test/data/blackbox/unsupported/06.jpg differ
diff --git a/core/test/data/blackbox/unsupported/07.jpg b/core/test/data/blackbox/unsupported/07.jpg
new file mode 100755 (executable)
index 0000000..71d20e5
Binary files /dev/null and b/core/test/data/blackbox/unsupported/07.jpg differ
diff --git a/core/test/data/blackbox/unsupported/08.jpg b/core/test/data/blackbox/unsupported/08.jpg
new file mode 100755 (executable)
index 0000000..b57f1a7
Binary files /dev/null and b/core/test/data/blackbox/unsupported/08.jpg differ
diff --git a/core/test/data/blackbox/unsupported/09.jpg b/core/test/data/blackbox/unsupported/09.jpg
new file mode 100755 (executable)
index 0000000..ca41269
Binary files /dev/null and b/core/test/data/blackbox/unsupported/09.jpg differ
diff --git a/core/test/data/blackbox/unsupported/10.jpg b/core/test/data/blackbox/unsupported/10.jpg
new file mode 100755 (executable)
index 0000000..84db282
Binary files /dev/null and b/core/test/data/blackbox/unsupported/10.jpg differ
index a077ccb..ae165f0 100644 (file)
@@ -35,4 +35,4 @@ public final class PartialBlackBoxTestCase extends AbstractNegativeBlackBoxTestC
     addTest(0, 270.0f);
   }
 
-}
\ No newline at end of file
+}
diff --git a/core/test/src/com/google/zxing/negative/UnsupportedBlackBoxTestCase.java b/core/test/src/com/google/zxing/negative/UnsupportedBlackBoxTestCase.java
new file mode 100644 (file)
index 0000000..6490855
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2008 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.zxing.negative;
+
+import com.google.zxing.common.AbstractNegativeBlackBoxTestCase;
+
+import java.io.File;
+
+/**
+ * This test ensures that unsupported barcodes do not decode.
+ *
+ * @author dswitkin@google.com (Daniel Switkin)
+ */
+public final class UnsupportedBlackBoxTestCase extends AbstractNegativeBlackBoxTestCase {
+
+  public UnsupportedBlackBoxTestCase() {
+    super(new File("test/data/blackbox/unsupported"));
+    addTest(0, 0.0f);
+    addTest(0, 90.0f);
+    addTest(1, 180.0f);
+    addTest(0, 270.0f);
+  }
+
+}