- Added a new unit test of 13 ITF images I took with a T-Mobile G1.
- 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: https://zxing.googlecode.com/svn/trunk@883 59b500cc-1b3d-0410-9834-0bbf25fbcc57
BIN
core/test/data/blackbox/itf-2/01.jpg
Executable file
After Width: | Height: | Size: 7.2 KiB |
1
core/test/data/blackbox/itf-2/01.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/02.jpg
Executable file
After Width: | Height: | Size: 9.1 KiB |
1
core/test/data/blackbox/itf-2/02.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/03.jpg
Executable file
After Width: | Height: | Size: 9.9 KiB |
1
core/test/data/blackbox/itf-2/03.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/04.jpg
Executable file
After Width: | Height: | Size: 9.5 KiB |
1
core/test/data/blackbox/itf-2/04.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/05.jpg
Executable file
After Width: | Height: | Size: 8.8 KiB |
1
core/test/data/blackbox/itf-2/05.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/06.jpg
Executable file
After Width: | Height: | Size: 8.3 KiB |
1
core/test/data/blackbox/itf-2/06.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/07.jpg
Executable file
After Width: | Height: | Size: 7 KiB |
1
core/test/data/blackbox/itf-2/07.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/08.jpg
Executable file
After Width: | Height: | Size: 7.8 KiB |
1
core/test/data/blackbox/itf-2/08.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/09.jpg
Executable file
After Width: | Height: | Size: 8.5 KiB |
1
core/test/data/blackbox/itf-2/09.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/10.jpg
Executable file
After Width: | Height: | Size: 9 KiB |
1
core/test/data/blackbox/itf-2/10.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/11.jpg
Executable file
After Width: | Height: | Size: 9.1 KiB |
1
core/test/data/blackbox/itf-2/11.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/12.jpg
Executable file
After Width: | Height: | Size: 8.4 KiB |
1
core/test/data/blackbox/itf-2/12.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
BIN
core/test/data/blackbox/itf-2/13.jpg
Executable file
After Width: | Height: | Size: 8.4 KiB |
1
core/test/data/blackbox/itf-2/13.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
070429
|
|
@ -17,13 +17,9 @@
|
||||||
package com.google.zxing.oned;
|
package com.google.zxing.oned;
|
||||||
|
|
||||||
import com.google.zxing.BarcodeFormat;
|
import com.google.zxing.BarcodeFormat;
|
||||||
import com.google.zxing.DecodeHintType;
|
|
||||||
import com.google.zxing.MultiFormatReader;
|
import com.google.zxing.MultiFormatReader;
|
||||||
import com.google.zxing.common.AbstractBlackBoxTestCase;
|
import com.google.zxing.common.AbstractBlackBoxTestCase;
|
||||||
|
|
||||||
import java.util.Hashtable;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kevin.osullivan@sita.aero
|
* @author kevin.osullivan@sita.aero
|
||||||
*/
|
*/
|
||||||
|
@ -32,27 +28,7 @@ public final class ITFBlackBox1TestCase extends AbstractBlackBoxTestCase {
|
||||||
public ITFBlackBox1TestCase() {
|
public ITFBlackBox1TestCase() {
|
||||||
super("test/data/blackbox/itf-1", new MultiFormatReader(), BarcodeFormat.ITF);
|
super("test/data/blackbox/itf-1", new MultiFormatReader(), BarcodeFormat.ITF);
|
||||||
addTest(9, 12, 0.0f);
|
addTest(9, 12, 0.0f);
|
||||||
}
|
addTest(8, 12, 180.0f);
|
||||||
|
|
||||||
// TODO(dswitkin): This is only used for the mean time because ITF is not turned on by default.
|
|
||||||
// The other formats are included here to make sure we don't recognize an ITF barcode as something
|
|
||||||
// else. Unfortunately this list is fragile. The right thing to do is profile ITF for performance,
|
|
||||||
// and if it doesn't impose significant overhead, turn it on by default. Then this method can be
|
|
||||||
// removed completely.
|
|
||||||
@Override
|
|
||||||
protected Hashtable<DecodeHintType, Object> getHints() {
|
|
||||||
Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(3);
|
|
||||||
Vector<BarcodeFormat> vector = new Vector<BarcodeFormat>();
|
|
||||||
vector.addElement(BarcodeFormat.UPC_A);
|
|
||||||
vector.addElement(BarcodeFormat.UPC_E);
|
|
||||||
vector.addElement(BarcodeFormat.EAN_13);
|
|
||||||
vector.addElement(BarcodeFormat.EAN_8);
|
|
||||||
vector.addElement(BarcodeFormat.CODE_39);
|
|
||||||
vector.addElement(BarcodeFormat.CODE_128);
|
|
||||||
vector.addElement(BarcodeFormat.ITF);
|
|
||||||
vector.addElement(BarcodeFormat.QR_CODE);
|
|
||||||
hints.put(DecodeHintType.POSSIBLE_FORMATS, vector);
|
|
||||||
return hints;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* 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.oned;
|
||||||
|
|
||||||
|
import com.google.zxing.BarcodeFormat;
|
||||||
|
import com.google.zxing.MultiFormatReader;
|
||||||
|
import com.google.zxing.common.AbstractBlackBoxTestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dswitkin@google.com (Daniel Switkin)
|
||||||
|
*/
|
||||||
|
public final class ITFBlackBox2TestCase extends AbstractBlackBoxTestCase {
|
||||||
|
|
||||||
|
public ITFBlackBox2TestCase() {
|
||||||
|
super("test/data/blackbox/itf-2", new MultiFormatReader(), BarcodeFormat.ITF);
|
||||||
|
addTest(8, 9, 0.0f);
|
||||||
|
addTest(8, 9, 180.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|