Skip to content

Commit 8b945ab

Browse files
committed
added test
1 parent e4756ef commit 8b945ab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jbbp/src/test/java/com/igormaznitsa/jbbp/io/JBBPBitInputStreamTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ private static JBBPBitInputStream asInputStreamMSB0(final int... array) {
6363
JBBPBitOrder.MSB0);
6464
}
6565

66+
@Test
67+
public void testReadLsb0Msb0() throws Exception {
68+
final byte[] data = new byte[] {0b0000_0001};
69+
assertEquals(0b0000_0001, new JBBPBitInputStream(new ByteArrayInputStream(data)).read());
70+
assertEquals(0b0000_0001,
71+
new JBBPBitInputStream(new ByteArrayInputStream(data), JBBPBitOrder.LSB0).read());
72+
assertEquals(0b1000_0000,
73+
new JBBPBitInputStream(new ByteArrayInputStream(data), JBBPBitOrder.MSB0).read());
74+
}
75+
6676
@Test
6777
public void testReadUnsignedShort_EOFforEmpty_BigEndian_EOFException() throws Exception {
6878
assertThrows(EOFException.class,

0 commit comments

Comments
 (0)