summaryrefslogtreecommitdiff
path: root/core/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/java/com')
-rw-r--r--core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java8
-rw-r--r--core/src/test/java/com/google/zxing/aztec/encoder/EncoderTest.java8
-rw-r--r--core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java11
-rw-r--r--core/src/test/java/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java10
-rw-r--r--core/src/test/java/com/google/zxing/maxicode/MaxiCodeBlackBox1TestCase.java2
-rw-r--r--core/src/test/java/com/google/zxing/maxicode/Maxicode1TestCase.java2
-rw-r--r--core/src/test/java/com/google/zxing/pdf417/PDF417BlackBox1TestCase.java8
-rw-r--r--core/src/test/java/com/google/zxing/qrcode/QRCodeBlackBox2TestCase.java8
8 files changed, 34 insertions, 23 deletions
diff --git a/core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java b/core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java
index 029abf2cb..340550680 100644
--- a/core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java
+++ b/core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java
@@ -26,10 +26,10 @@ public final class AztecBlackBox1TestCase extends AbstractBlackBoxTestCase {
public AztecBlackBox1TestCase() {
super("src/test/resources/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC);
- addTest(14, 14, 0.0f);
- addTest(14, 14, 90.0f);
- addTest(14, 14, 180.0f);
- addTest(14, 14, 270.0f);
+ addTest(15, 15, 0.0f);
+ addTest(15, 15, 90.0f);
+ addTest(15, 15, 180.0f);
+ addTest(15, 15, 270.0f);
}
}
diff --git a/core/src/test/java/com/google/zxing/aztec/encoder/EncoderTest.java b/core/src/test/java/com/google/zxing/aztec/encoder/EncoderTest.java
index b8aa838ed..280018d6d 100644
--- a/core/src/test/java/com/google/zxing/aztec/encoder/EncoderTest.java
+++ b/core/src/test/java/com/google/zxing/aztec/encoder/EncoderTest.java
@@ -493,7 +493,7 @@ public final class EncoderTest extends Assert {
assertEquals("Unexpected nr. of layers", layers, aztec.getLayers());
BitMatrix matrix = aztec.getMatrix();
AztecDetectorResult r =
- new AztecDetectorResult(matrix, NO_POINTS, aztec.isCompact(), aztec.getCodeWords(), aztec.getLayers());
+ new AztecDetectorResult(matrix, NO_POINTS, aztec.isCompact(), aztec.getCodeWords(), aztec.getLayers(), 0);
DecoderResult res = new Decoder().decode(r);
assertEquals(data, res.getText());
// Check error correction by introducing a few minor errors
@@ -502,7 +502,7 @@ public final class EncoderTest extends Assert {
matrix.flip(random.nextInt(matrix.getWidth()), matrix.getHeight() - 2 + random.nextInt(2));
matrix.flip(random.nextInt(2), random.nextInt(matrix.getHeight()));
matrix.flip(matrix.getWidth() - 2 + random.nextInt(2), random.nextInt(matrix.getHeight()));
- r = new AztecDetectorResult(matrix, NO_POINTS, aztec.isCompact(), aztec.getCodeWords(), aztec.getLayers());
+ r = new AztecDetectorResult(matrix, NO_POINTS, aztec.isCompact(), aztec.getCodeWords(), aztec.getLayers(), 0);
res = new Decoder().decode(r);
assertEquals(data, res.getText());
}
@@ -527,7 +527,7 @@ public final class EncoderTest extends Assert {
BitMatrix matrix2 = aztec.getMatrix();
assertEquals(matrix, matrix2);
AztecDetectorResult r =
- new AztecDetectorResult(matrix, NO_POINTS, aztec.isCompact(), aztec.getCodeWords(), aztec.getLayers());
+ new AztecDetectorResult(matrix, NO_POINTS, aztec.isCompact(), aztec.getCodeWords(), aztec.getLayers(), 0);
DecoderResult res = new Decoder().decode(r);
assertEquals(data, res.getText());
// Check error correction by introducing up to eccPercent/2 errors
@@ -543,7 +543,7 @@ public final class EncoderTest extends Assert {
: matrix.getHeight() - 1 - random.nextInt(aztec.getLayers() * 2);
matrix.flip(x, y);
}
- r = new AztecDetectorResult(matrix, NO_POINTS, aztec.isCompact(), aztec.getCodeWords(), aztec.getLayers());
+ r = new AztecDetectorResult(matrix, NO_POINTS, aztec.isCompact(), aztec.getCodeWords(), aztec.getLayers(), 0);
res = new Decoder().decode(r);
assertEquals(data, res.getText());
}
diff --git a/core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java b/core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java
index f295f31dc..adce02a89 100644
--- a/core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java
+++ b/core/src/test/java/com/google/zxing/common/AbstractBlackBoxTestCase.java
@@ -165,6 +165,8 @@ public abstract class AbstractBlackBoxTestCase extends Assert {
try (BufferedReader reader = Files.newBufferedReader(expectedMetadataFile, StandardCharsets.UTF_8)) {
expectedMetadata.load(reader);
}
+ correctInteger(expectedMetadata, ResultMetadataType.ERRORS_CORRECTED);
+ correctInteger(expectedMetadata, ResultMetadataType.ERASURES_CORRECTED);
}
for (int x = 0; x < testCount; x++) {
@@ -249,6 +251,15 @@ public abstract class AbstractBlackBoxTestCase extends Assert {
}
}
+ private static void correctInteger(Properties metadata, ResultMetadataType key) {
+ String skey = key.toString();
+ if (metadata.containsKey(skey)) {
+ String sval = metadata.getProperty(skey);
+ Integer ival = Integer.parseInt(sval);
+ metadata.put(skey, ival);
+ }
+ }
+
private boolean decode(BinaryBitmap source,
float rotation,
String expectedText,
diff --git a/core/src/test/java/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java b/core/src/test/java/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java
index 540cc5038..e344f5ad1 100644
--- a/core/src/test/java/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java
+++ b/core/src/test/java/com/google/zxing/datamatrix/DataMatrixBlackBox1TestCase.java
@@ -27,10 +27,10 @@ public final class DataMatrixBlackBox1TestCase extends AbstractBlackBoxTestCase
public DataMatrixBlackBox1TestCase() {
super("src/test/resources/blackbox/datamatrix-1", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
- addTest(21, 21, 0.0f);
- addTest(21, 21, 90.0f);
- addTest(21, 21, 180.0f);
- addTest(21, 21, 270.0f);
+ addTest(22, 22, 0.0f);
+ addTest(22, 22, 90.0f);
+ addTest(22, 22, 180.0f);
+ addTest(22, 22, 270.0f);
}
-} \ No newline at end of file
+}
diff --git a/core/src/test/java/com/google/zxing/maxicode/MaxiCodeBlackBox1TestCase.java b/core/src/test/java/com/google/zxing/maxicode/MaxiCodeBlackBox1TestCase.java
index ed0265620..9324965b3 100644
--- a/core/src/test/java/com/google/zxing/maxicode/MaxiCodeBlackBox1TestCase.java
+++ b/core/src/test/java/com/google/zxing/maxicode/MaxiCodeBlackBox1TestCase.java
@@ -32,7 +32,7 @@ public final class MaxiCodeBlackBox1TestCase extends AbstractBlackBoxTestCase {
public MaxiCodeBlackBox1TestCase() {
super("src/test/resources/blackbox/maxicode-1", new MultiFormatReader(), BarcodeFormat.MAXICODE);
addHint(DecodeHintType.PURE_BARCODE);
- addTest(7, 7, 0.0f);
+ addTest(8, 8, 0.0f);
}
}
diff --git a/core/src/test/java/com/google/zxing/maxicode/Maxicode1TestCase.java b/core/src/test/java/com/google/zxing/maxicode/Maxicode1TestCase.java
index 6d3f49b0f..a9ea5dc99 100644
--- a/core/src/test/java/com/google/zxing/maxicode/Maxicode1TestCase.java
+++ b/core/src/test/java/com/google/zxing/maxicode/Maxicode1TestCase.java
@@ -27,7 +27,7 @@ public final class Maxicode1TestCase extends AbstractBlackBoxTestCase {
public Maxicode1TestCase() {
super("src/test/resources/blackbox/maxicode-1", new MultiFormatReader(), BarcodeFormat.MAXICODE);
- addTest(7, 7, 0.0f);
+ addTest(8, 8, 0.0f);
}
}
diff --git a/core/src/test/java/com/google/zxing/pdf417/PDF417BlackBox1TestCase.java b/core/src/test/java/com/google/zxing/pdf417/PDF417BlackBox1TestCase.java
index c4060cab6..49a1fa63f 100644
--- a/core/src/test/java/com/google/zxing/pdf417/PDF417BlackBox1TestCase.java
+++ b/core/src/test/java/com/google/zxing/pdf417/PDF417BlackBox1TestCase.java
@@ -29,10 +29,10 @@ public final class PDF417BlackBox1TestCase extends AbstractBlackBoxTestCase {
public PDF417BlackBox1TestCase() {
super("src/test/resources/blackbox/pdf417-1", new MultiFormatReader(), BarcodeFormat.PDF_417);
- addTest(12, 12, 0.0f);
- addTest(12, 12, 90.0f);
- addTest(12, 12, 180.0f);
- addTest(12, 12, 270.0f);
+ addTest(13, 13, 0.0f);
+ addTest(13, 13, 90.0f);
+ addTest(13, 13, 180.0f);
+ addTest(13, 13, 270.0f);
}
}
diff --git a/core/src/test/java/com/google/zxing/qrcode/QRCodeBlackBox2TestCase.java b/core/src/test/java/com/google/zxing/qrcode/QRCodeBlackBox2TestCase.java
index 111c2286a..e2ceb7e50 100644
--- a/core/src/test/java/com/google/zxing/qrcode/QRCodeBlackBox2TestCase.java
+++ b/core/src/test/java/com/google/zxing/qrcode/QRCodeBlackBox2TestCase.java
@@ -27,10 +27,10 @@ public final class QRCodeBlackBox2TestCase extends AbstractBlackBoxTestCase {
public QRCodeBlackBox2TestCase() {
super("src/test/resources/blackbox/qrcode-2", new MultiFormatReader(), BarcodeFormat.QR_CODE);
- addTest(31, 31, 0.0f);
- addTest(29, 29, 90.0f);
- addTest(30, 30, 180.0f);
- addTest(30, 30, 270.0f);
+ addTest(32, 32, 0.0f);
+ addTest(30, 30, 90.0f);
+ addTest(31, 31, 180.0f);
+ addTest(31, 31, 270.0f);
}
}