diff options
| author | Sean Owen <srowen@gmail.com> | 2018-03-23 19:04:52 +0300 |
|---|---|---|
| committer | Sean Owen <srowen@gmail.com> | 2018-03-23 19:04:52 +0300 |
| commit | d352c5f159dafafc1d760ca965504aadc1e30bed (patch) | |
| tree | 7872f1b9afbba041cdee403b5ad7fc0bbd32dea7 /core/src/test/java/com | |
| parent | dbfd5520e9b53de492cc4ff8f8c55a440f0d6b5d (diff) | |
| download | zxing-d352c5f159dafafc1d760ca965504aadc1e30bed.tar.xz | |
Fix a few typos in new PDF 417 test
Diffstat (limited to 'core/src/test/java/com')
| -rw-r--r-- | core/src/test/java/com/google/zxing/pdf417/decoder/PDF417DecoderTestCase.java (renamed from core/src/test/java/com/google/zxing/pdf417/decoder/PDF471DecoderTestCase.java) | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/core/src/test/java/com/google/zxing/pdf417/decoder/PDF471DecoderTestCase.java b/core/src/test/java/com/google/zxing/pdf417/decoder/PDF417DecoderTestCase.java index 0d66a4028..334def2d3 100644 --- a/core/src/test/java/com/google/zxing/pdf417/decoder/PDF471DecoderTestCase.java +++ b/core/src/test/java/com/google/zxing/pdf417/decoder/PDF417DecoderTestCase.java @@ -18,11 +18,10 @@ package com.google.zxing.pdf417.decoder; import com.google.zxing.FormatException; import com.google.zxing.pdf417.PDF417ResultMetadata; +import org.junit.Assert; import org.junit.Test; -import static org.junit.Assert.*; - -public class PDF471DecoderTestCase { +public class PDF417DecoderTestCase extends Assert { /** * Tests the first sample given in ISO/IEC 15438:2015(E) - Annex H.4 @@ -43,9 +42,11 @@ public class PDF471DecoderTestCase { assertEquals("CEN BE", resultMetadata.getSender()); assertEquals("ISO CH", resultMetadata.getAddressee()); + @SuppressWarnings("deprecation") int[] optionalData = resultMetadata.getOptionalData(); assertEquals("first element of optional array should be the first field identifier", 1, optionalData[0]); - assertEquals("last element of optional array should be the last codeword of the last field", 67, optionalData[optionalData.length - 1]); + assertEquals("last element of optional array should be the last codeword of the last field", + 67, optionalData[optionalData.length - 1]); } @@ -68,15 +69,18 @@ public class PDF471DecoderTestCase { assertNull(resultMetadata.getAddressee()); assertNull(resultMetadata.getSender()); - + @SuppressWarnings("deprecation") int[] optionalData = resultMetadata.getOptionalData(); assertEquals("first element of optional array should be the first field identifier", 1, optionalData[0]); - assertEquals("last element of optional array should be the last codeword of the last field", 104, optionalData[optionalData.length - 1]); + assertEquals("last element of optional array should be the last codeword of the last field", + 104, optionalData[optionalData.length - 1]); } @Test public void testSampleWithFilename() throws FormatException { - int[] sampleCodes = {23, 477, 928, 111, 100, 0, 252, 21, 86, 923, 0, 815, 251, 133, 12, 148, 537, 593, 599, 923, 1, 111, 102, 98, 311, 355, 522, 920, 779, 40, 628, 33, 749, 267, 506, 213, 928, 465, 248, 493, 72, 780, 699, 780, 493, 755, 84, 198, 628, 368, 156, 198, 809, 19, 113}; + int[] sampleCodes = {23, 477, 928, 111, 100, 0, 252, 21, 86, 923, 0, 815, 251, 133, 12, 148, 537, 593, + 599, 923, 1, 111, 102, 98, 311, 355, 522, 920, 779, 40, 628, 33, 749, 267, 506, 213, 928, 465, 248, + 493, 72, 780, 699, 780, 493, 755, 84, 198, 628, 368, 156, 198, 809, 19, 113}; PDF417ResultMetadata resultMetadata = new PDF417ResultMetadata(); DecodedBitStreamParser.decodeMacroBlock(sampleCodes, 3, resultMetadata); @@ -92,7 +96,8 @@ public class PDF471DecoderTestCase { @Test public void testSampleWithNumericValues() throws FormatException { - int[] sampleCodes = {25, 477, 928, 111, 100, 0, 252, 21, 86, 923, 2, 2, 0, 1, 0, 0, 0, 923, 5, 130, 923, 6, 1, 500, 13, 0}; + int[] sampleCodes = {25, 477, 928, 111, 100, 0, 252, 21, 86, 923, 2, 2, 0, 1, 0, 0, 0, 923, 5, 130, 923, + 6, 1, 500, 13, 0}; PDF417ResultMetadata resultMetadata = new PDF417ResultMetadata(); DecodedBitStreamParser.decodeMacroBlock(sampleCodes, 3, resultMetadata); @@ -104,7 +109,6 @@ public class PDF471DecoderTestCase { assertEquals(180980729000000L, resultMetadata.getTimestamp()); assertEquals(30, resultMetadata.getFileSize()); assertEquals(260013, resultMetadata.getChecksum()); - } } |
