PDF417EncoderTestCase.java (zxing-zxing-3.4.1) | : | PDF417EncoderTestCase.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
import org.junit.Test; | import org.junit.Test; | |||
/** | /** | |||
* Tests {@link PDF417HighLevelEncoder}. | * Tests {@link PDF417HighLevelEncoder}. | |||
*/ | */ | |||
public final class PDF417EncoderTestCase extends Assert { | public final class PDF417EncoderTestCase extends Assert { | |||
@Test | @Test | |||
public void testEncodeAuto() throws Exception { | public void testEncodeAuto() throws Exception { | |||
String encoded = PDF417HighLevelEncoder.encodeHighLevel( | String encoded = PDF417HighLevelEncoder.encodeHighLevel( | |||
"ABCD", Compaction.AUTO, StandardCharsets.UTF_8); | "ABCD", Compaction.AUTO, StandardCharsets.UTF_8, false); | |||
assertEquals("\u039f\u001A\u0385ABCD", encoded); | assertEquals("\u039f\u001A\u0385ABCD", encoded); | |||
} | } | |||
@Test | @Test | |||
public void testEncodeAutoWithSpecialChars() throws Exception { | public void testEncodeAutoWithSpecialChars() throws Exception { | |||
// Just check if this does not throw an exception | // Just check if this does not throw an exception | |||
PDF417HighLevelEncoder.encodeHighLevel( | PDF417HighLevelEncoder.encodeHighLevel( | |||
"1%§s ?aG$", Compaction.AUTO, StandardCharsets.UTF_8); | "1%§s ?aG$", Compaction.AUTO, StandardCharsets.UTF_8, false); | |||
} | } | |||
@Test | @Test | |||
public void testEncodeIso88591WithSpecialChars() throws Exception { | public void testEncodeIso88591WithSpecialChars() throws Exception { | |||
// Just check if this does not throw an exception | // Just check if this does not throw an exception | |||
PDF417HighLevelEncoder.encodeHighLevel("asdfg§asd", Compaction.AUTO, Standar dCharsets.ISO_8859_1); | PDF417HighLevelEncoder.encodeHighLevel("asdfg§asd", Compaction.AUTO, Standar dCharsets.ISO_8859_1, false); | |||
} | } | |||
@Test | @Test | |||
public void testEncodeText() throws Exception { | public void testEncodeText() throws Exception { | |||
String encoded = PDF417HighLevelEncoder.encodeHighLevel( | String encoded = PDF417HighLevelEncoder.encodeHighLevel( | |||
"ABCD", Compaction.TEXT, StandardCharsets.UTF_8); | "ABCD", Compaction.TEXT, StandardCharsets.UTF_8, false); | |||
assertEquals("Ο\u001A\u0001?", encoded); | assertEquals("Ο\u001A\u0001?", encoded); | |||
} | } | |||
@Test | @Test | |||
public void testEncodeNumeric() throws Exception { | public void testEncodeNumeric() throws Exception { | |||
String encoded = PDF417HighLevelEncoder.encodeHighLevel( | String encoded = PDF417HighLevelEncoder.encodeHighLevel( | |||
"1234", Compaction.NUMERIC, StandardCharsets.UTF_8); | "1234", Compaction.NUMERIC, StandardCharsets.UTF_8, false); | |||
assertEquals("\u039f\u001A\u0386\f\u01b2", encoded); | assertEquals("\u039f\u001A\u0386\f\u01b2", encoded); | |||
} | } | |||
@Test | @Test | |||
public void testEncodeByte() throws Exception { | public void testEncodeByte() throws Exception { | |||
String encoded = PDF417HighLevelEncoder.encodeHighLevel( | String encoded = PDF417HighLevelEncoder.encodeHighLevel( | |||
"abcd", Compaction.BYTE, StandardCharsets.UTF_8); | "abcd", Compaction.BYTE, StandardCharsets.UTF_8, false); | |||
assertEquals("\u039f\u001A\u0385abcd", encoded); | assertEquals("\u039f\u001A\u0385abcd", encoded); | |||
} | } | |||
} | } | |||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 6 lines changed or added |