Skip to content

Commit

Permalink
Add tests for Array<Byte> method as well as byte[] method.
Browse files Browse the repository at this point in the history
  • Loading branch information
nishihatapalmer committed May 5, 2019
1 parent 1091f9a commit 5df6399
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/test/java/net/byteseek/utils/ByteUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1437,8 +1437,16 @@ public void testSingleBytesToString() {
}

private void testBytesToString(String description, String byteString, String prettyString, byte... array) {
assertEquals(description, byteString, ByteUtils.bytesToString(false, array));
assertEquals(description, byteString, ByteUtils.bytesToString(false, array));
assertEquals(description + " pretty", prettyString, ByteUtils.bytesToString(true, array));

List<Byte> byteList = new ArrayList<Byte>(array.length);
for (byte b : array) {
byteList.add(b);
}

assertEquals(description, byteString, ByteUtils.bytesToString(false, byteList));
assertEquals(description + " pretty", prettyString, ByteUtils.bytesToString(true, byteList));
}

@Test
Expand Down Expand Up @@ -1605,5 +1613,7 @@ private List<Byte> toList(int... integers) {
}
return list;
}



}

0 comments on commit 5df6399

Please sign in to comment.