mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Fix RS encoder test, per hwkns
git-svn-id: https://zxing.googlecode.com/svn/trunk@2236 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
75d26706c2
commit
674783b8dd
|
@ -45,7 +45,7 @@ public final class ReedSolomonEncoderQRCodeTestCase extends AbstractReedSolomonT
|
|||
ReedSolomonEncoder encoder = new ReedSolomonEncoder(GenericGF.QR_CODE_FIELD_256);
|
||||
ReedSolomonDecoder decoder = new ReedSolomonDecoder(GenericGF.QR_CODE_FIELD_256);
|
||||
for (int i = 0; i < 100; i++) {
|
||||
int size = 1 + random.nextInt(1000);
|
||||
int size = 2 + random.nextInt(254);
|
||||
int[] toEncode = new int[size];
|
||||
int ecBytes = 1 + random.nextInt(2 * (1 + size / 8));
|
||||
ecBytes = Math.min(ecBytes, size - 1);
|
||||
|
@ -56,6 +56,7 @@ public final class ReedSolomonEncoderQRCodeTestCase extends AbstractReedSolomonT
|
|||
int[] original = new int[dataBytes];
|
||||
System.arraycopy(toEncode, 0, original, 0, dataBytes);
|
||||
encoder.encode(toEncode, ecBytes);
|
||||
corrupt(toEncode, ecBytes / 2, random);
|
||||
decoder.decode(toEncode, ecBytes);
|
||||
assertArraysEqual(original, 0, toEncode, 0, dataBytes);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue