UPCAWriterTestCase.java (zxing-zxing-3.4.1) | : | UPCAWriterTestCase.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
import org.junit.Assert; | import org.junit.Assert; | |||
import org.junit.Test; | import org.junit.Test; | |||
/** | /** | |||
* @author qwandor@google.com (Andrew Walbran) | * @author qwandor@google.com (Andrew Walbran) | |||
*/ | */ | |||
public final class UPCAWriterTestCase extends Assert { | public final class UPCAWriterTestCase extends Assert { | |||
@Test | @Test | |||
public void testEncode() { | public void testEncode() { | |||
String testStr = "0000101010001101101110110001000101101011110111101010101110 | String testStr = | |||
0101110100100111011001101101100101110010100000"; | "00001010100011011011101100010001011010111101111010101011100101110100100 | |||
111011001101101100101110010100000"; | ||||
BitMatrix result = new UPCAWriter().encode("485963095124", BarcodeFormat.UPC _A, testStr.length(), 0); | BitMatrix result = new UPCAWriter().encode("485963095124", BarcodeFormat.UPC _A, testStr.length(), 0); | |||
assertEquals(testStr, BitMatrixTestCase.matrixToString(result)); | assertEquals(testStr, BitMatrixTestCase.matrixToString(result)); | |||
} | } | |||
@Test | @Test | |||
public void testAddChecksumAndEncode() { | public void testAddChecksumAndEncode() { | |||
String testStr = "0000101001100100100110111101010001101100010101111010101000 | String testStr = | |||
1001001000111010011100101100110110110010100000"; | "00001010011001001001101111010100011011000101011110101010001001001000111 | |||
010011100101100110110110010100000"; | ||||
BitMatrix result = new UPCAWriter().encode("12345678901", BarcodeFormat.UPC_ A, testStr.length(), 0); | BitMatrix result = new UPCAWriter().encode("12345678901", BarcodeFormat.UPC_ A, testStr.length(), 0); | |||
assertEquals(testStr, BitMatrixTestCase.matrixToString(result)); | assertEquals(testStr, BitMatrixTestCase.matrixToString(result)); | |||
} | } | |||
} | } | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 6 lines changed or added |