diff options
author | Yuuta Liang <yuutaw@students.cs.ubc.ca> | 2023-10-14 05:35:17 +0800 |
---|---|---|
committer | Yuuta Liang <yuutaw@students.cs.ubc.ca> | 2023-10-14 05:35:17 +0800 |
commit | 28fa18278c1f3a87722d5e8b78f581526a30bb38 (patch) | |
tree | 2f23f6e2e222a78f40809ec37e8b28a29cba3d3c /src/test/model/asn1/IA5StringTest.java | |
parent | 0bcc057e741af3fbc108f42b75f9d42f48f6a51e (diff) | |
download | jca-28fa18278c1f3a87722d5e8b78f581526a30bb38.tar jca-28fa18278c1f3a87722d5e8b78f581526a30bb38.tar.gz jca-28fa18278c1f3a87722d5e8b78f581526a30bb38.tar.bz2 jca-28fa18278c1f3a87722d5e8b78f581526a30bb38.zip |
Fix lint
Signed-off-by: Yuuta Liang <yuutaw@students.cs.ubc.ca>
Diffstat (limited to 'src/test/model/asn1/IA5StringTest.java')
-rw-r--r-- | src/test/model/asn1/IA5StringTest.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/test/model/asn1/IA5StringTest.java b/src/test/model/asn1/IA5StringTest.java index dfaa1aa..8bec6c4 100644 --- a/src/test/model/asn1/IA5StringTest.java +++ b/src/test/model/asn1/IA5StringTest.java @@ -32,25 +32,25 @@ public class IA5StringTest { void testIllegalStrings() { assertThrows(ParseException.class, () -> new IA5String(IA5String.TAG, null, - stringToTest + new String(new byte[]{ -128 }, StandardCharsets.UTF_8))); + stringToTest + new String(new byte[]{-128}, StandardCharsets.UTF_8))); assertThrows(ParseException.class, () -> new IA5String(IA5String.TAG, null, - stringToTest + new String(new byte[]{ -1 }, StandardCharsets.UTF_8))); + stringToTest + new String(new byte[]{-1}, StandardCharsets.UTF_8))); } @Test void testEncode() throws ParseException { assertArrayEquals( - new Byte[] { 0x00, 0x01, 0x02 }, - new IA5String(IA5String.TAG, null, new String(new byte[]{ 0, 1, 2}, StandardCharsets.UTF_8)) + new Byte[]{0x00, 0x01, 0x02}, + new IA5String(IA5String.TAG, null, new String(new byte[]{0, 1, 2}, StandardCharsets.UTF_8)) .encodeValueDER()); assertArrayEquals( - new Byte[] { + new Byte[]{ 0x16, 0x02, // Tag - Length 0x68, 0x69 // Value }, new IA5String(IA5String.TAG, null, "hi").encodeDER()); assertArrayEquals( - new Byte[] { + new Byte[]{ -85, 0x05, // Parent Tag - Length 0x16, 0x03, // Inner Tag - Length 0x68, 0x69, 0x69 // Value @@ -62,18 +62,18 @@ public class IA5StringTest { @Test void testParse() throws ParseException { assertEquals("123", - new IA5String(new BytesReader(new Byte[]{ 0x16, 3, '1', '2', '3' }), false) + new IA5String(new BytesReader(new Byte[]{0x16, 3, '1', '2', '3'}), false) .getString()); assertEquals("", - new IA5String(new BytesReader(new Byte[]{ 0x16, 0 }), false) + new IA5String(new BytesReader(new Byte[]{0x16, 0}), false) .getString()); } @Test void testParseFail() { - assertThrows(ParseException.class, () -> - new IA5String(new BytesReader(new Byte[]{ 0x16, 3, '1', '2' }), false)); - assertThrows(ParseException.class, () -> - new IA5String(new BytesReader(new Byte[]{ 0x16, 2, '1', -128 }), false)); + assertThrows(ParseException.class, () -> + new IA5String(new BytesReader(new Byte[]{0x16, 3, '1', '2'}), false)); + assertThrows(ParseException.class, () -> + new IA5String(new BytesReader(new Byte[]{0x16, 2, '1', -128}), false)); } } |