mirror of
https://github.com/zxing/zxing.git
synced 2025-02-21 02:55:27 -08:00
Don't run Aztec test 1000 times pointlessly
This commit is contained in:
parent
4d94ac22eb
commit
1cc5cbe961
|
@ -128,22 +128,20 @@ public final class EncoderTest extends Assert {
|
|||
|
||||
@Test
|
||||
public void testAztecWriter() throws Exception {
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
testWriter("\u20AC 1 sample data.", "ISO-8859-1", 25, true, 2);
|
||||
testWriter("\u20AC 1 sample data.", "ISO-8859-15", 25, true, 2);
|
||||
testWriter("\u20AC 1 sample data.", "UTF-8", 25, true, 2);
|
||||
testWriter("\u20AC 1 sample data.", "UTF-8", 100, true, 3);
|
||||
testWriter("\u20AC 1 sample data.", "UTF-8", 300, true, 4);
|
||||
testWriter("\u20AC 1 sample data.", "UTF-8", 500, false, 5);
|
||||
// Test AztecWriter defaults
|
||||
String data = "In ut magna vel mauris malesuada";
|
||||
AztecWriter writer = new AztecWriter();
|
||||
BitMatrix matrix = writer.encode(data, BarcodeFormat.AZTEC, 0, 0);
|
||||
AztecCode aztec = Encoder.encode(data.getBytes(StandardCharsets.ISO_8859_1),
|
||||
Encoder.DEFAULT_EC_PERCENT, Encoder.DEFAULT_AZTEC_LAYERS);
|
||||
BitMatrix expectedMatrix = aztec.getMatrix();
|
||||
assertEquals(matrix, expectedMatrix);
|
||||
}
|
||||
testWriter("\u20AC 1 sample data.", "ISO-8859-1", 25, true, 2);
|
||||
testWriter("\u20AC 1 sample data.", "ISO-8859-15", 25, true, 2);
|
||||
testWriter("\u20AC 1 sample data.", "UTF-8", 25, true, 2);
|
||||
testWriter("\u20AC 1 sample data.", "UTF-8", 100, true, 3);
|
||||
testWriter("\u20AC 1 sample data.", "UTF-8", 300, true, 4);
|
||||
testWriter("\u20AC 1 sample data.", "UTF-8", 500, false, 5);
|
||||
// Test AztecWriter defaults
|
||||
String data = "In ut magna vel mauris malesuada";
|
||||
AztecWriter writer = new AztecWriter();
|
||||
BitMatrix matrix = writer.encode(data, BarcodeFormat.AZTEC, 0, 0);
|
||||
AztecCode aztec = Encoder.encode(data.getBytes(StandardCharsets.ISO_8859_1),
|
||||
Encoder.DEFAULT_EC_PERCENT, Encoder.DEFAULT_AZTEC_LAYERS);
|
||||
BitMatrix expectedMatrix = aztec.getMatrix();
|
||||
assertEquals(matrix, expectedMatrix);
|
||||
}
|
||||
|
||||
// synthetic tests (encode-decode round-trip)
|
||||
|
|
Loading…
Reference in a new issue