diff options
| author | Sean Owen <srowen@gmail.com> | 2016-05-05 23:28:33 +0300 |
|---|---|---|
| committer | Sean Owen <srowen@gmail.com> | 2016-05-05 23:28:33 +0300 |
| commit | 7a4e0935b59119be34cef041595cdb96e575d26c (patch) | |
| tree | 58d18ea695725658a826b924c0bd6ef9814c67ef /core/src/test/java | |
| parent | a8b78c16f5900a156969996f7aad93c2e21fca17 (diff) | |
| parent | ee48b3e5d384fa81d928f647a1e463f780223be5 (diff) | |
| download | zxing-7a4e0935b59119be34cef041595cdb96e575d26c.tar.xz | |
Merge pull request #591 from tanelihuuskonen/master
Aztec decoder returns raw bytes
Diffstat (limited to 'core/src/test/java')
| -rw-r--r-- | core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java b/core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java index ce5b8a441..5bab590fd 100644 --- a/core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java +++ b/core/src/test/java/com/google/zxing/aztec/decoder/DecoderTest.java @@ -20,8 +20,9 @@ import com.google.zxing.ResultPoint; import com.google.zxing.aztec.AztecDetectorResult; import com.google.zxing.common.BitMatrix; import org.junit.Test; +import org.junit.Assert; -public final class DecoderTest { +public final class DecoderTest extends Assert { private static final ResultPoint[] NO_POINTS = new ResultPoint[0]; @@ -105,4 +106,28 @@ public final class DecoderTest { new Decoder().decode(r); } + @Test + public void testRawBytes() { + boolean[] bool0 = {}; + boolean[] bool1 = { true }; + boolean[] bool7 = { true, false, true, false, true, false, true }; + boolean[] bool8 = { true, false, true, false, true, false, true, false }; + boolean[] bool9 = { true, false, true, false, true, false, true, false, + true }; + boolean[] bool16 = { false, true, true, false, false, false, true, true, + true, true, false, false, false, false, false, true }; + byte[] byte0 = {}; + byte[] byte1 = { -128 }; + byte[] byte7 = { -86 }; + byte[] byte8 = { -86 }; + byte[] byte9 = { -86, -128 }; + byte[] byte16 = { 99, -63 }; + + assertArrayEquals(byte0, Decoder.convertBoolArrayToByteArray(bool0)); + assertArrayEquals(byte1, Decoder.convertBoolArrayToByteArray(bool1)); + assertArrayEquals(byte7, Decoder.convertBoolArrayToByteArray(bool7)); + assertArrayEquals(byte8, Decoder.convertBoolArrayToByteArray(bool8)); + assertArrayEquals(byte9, Decoder.convertBoolArrayToByteArray(bool9)); + assertArrayEquals(byte16, Decoder.convertBoolArrayToByteArray(bool16)); + } } |
