package com.google.zxing.common.reedsolomon;
+import org.junit.Test;
+
import java.util.Random;
/**
private final ReedSolomonDecoder dmRSDecoder = new ReedSolomonDecoder(GF256.DATA_MATRIX_FIELD);
+ @Test
public void testNoError() throws ReedSolomonException {
int[] received = new int[DM_CODE_TEST_WITH_EC.length];
System.arraycopy(DM_CODE_TEST_WITH_EC, 0, received, 0, received.length);
checkQRRSDecode(received);
}
+ @Test
public void testOneError() throws ReedSolomonException {
int[] received = new int[DM_CODE_TEST_WITH_EC.length];
Random random = getRandom();
}
}
+ @Test
public void testMaxErrors() throws ReedSolomonException {
int[] received = new int[DM_CODE_TEST_WITH_EC.length];
Random random = getRandom();
- for (int i = 0; i < DM_CODE_TEST.length; i++) { // # iterations is kind of arbitrary
+ for (int test : DM_CODE_TEST) { // # iterations is kind of arbitrary
System.arraycopy(DM_CODE_TEST_WITH_EC, 0, received, 0, received.length);
corrupt(received, DM_CODE_CORRECTABLE, random);
checkQRRSDecode(received);
}
}
+ @Test
public void testTooManyErrors() {
int[] received = new int[DM_CODE_TEST_WITH_EC.length];
System.arraycopy(DM_CODE_TEST_WITH_EC, 0, received, 0, received.length);