diff options
| author | MakKi (makki_d) <d.makiuchi+gh@gmail.com> | 2018-06-03 06:32:30 +0300 |
|---|---|---|
| committer | Sean Owen <srowen@gmail.com> | 2018-06-03 06:32:30 +0300 |
| commit | 3778715156fac37e82fb7f2c4b604e3909a42ac7 (patch) | |
| tree | bc36360101b6eef7d37562980c06b55e8600ad40 /core/src/test/java | |
| parent | 4d39673d67ddaac3df71e61a51429ec94f687495 (diff) | |
| download | zxing-3778715156fac37e82fb7f2c4b604e3909a42ac7.tar.xz | |
String of zero polynomial be "0" (#1020)
* String of zero polynomial be "0"
* add test
* add more test
* modify test case
Diffstat (limited to 'core/src/test/java')
| -rw-r--r-- | core/src/test/java/com/google/zxing/common/reedsolomon/ReedSolomonTestCase.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/src/test/java/com/google/zxing/common/reedsolomon/ReedSolomonTestCase.java b/core/src/test/java/com/google/zxing/common/reedsolomon/ReedSolomonTestCase.java index 834433b10..c483d50e7 100644 --- a/core/src/test/java/com/google/zxing/common/reedsolomon/ReedSolomonTestCase.java +++ b/core/src/test/java/com/google/zxing/common/reedsolomon/ReedSolomonTestCase.java @@ -393,6 +393,13 @@ public final class ReedSolomonTestCase extends Assert { testEncodeDecodeRandom(GenericGF.AZTEC_DATA_12, 3072, 1023); } + @Test + public void testPolynomialString() { + assertEquals("0", GenericGF.QR_CODE_FIELD_256.getZero().toString()); + GenericGFPoly p = new GenericGFPoly(GenericGF.QR_CODE_FIELD_256, new int[] {3, 0, -2, 1, 1}); + assertEquals("a^25x^4 - ax^2 + x + 1", p.toString()); + } + public static void corrupt(int[] received, int howMany, Random random, int max) { BitSet corrupted = new BitSet(received.length); for (int j = 0; j < howMany; j++) { @@ -503,4 +510,4 @@ public final class ReedSolomonTestCase extends Assert { return new Random(0xDEADBEEF); } -}
\ No newline at end of file +} |
