Skip to content
Permalink
Browse files
Fix broken tests.
  • Loading branch information
garydgregory committed May 5, 2022
1 parent 328cdda commit b9a902234f0ce3d79907999418e5504f2f603250
Showing 1 changed file with 3 additions and 2 deletions.
@@ -19,6 +19,7 @@
package org.apache.commons.compress.utils;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;

import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -31,14 +32,14 @@ public class BitInputStreamTest {
@Test
public void shouldNotAllowReadingOfANegativeAmountOfBits() throws IOException {
try (final BitInputStream bis = new BitInputStream(getStream(), ByteOrder.LITTLE_ENDIAN)) {
bis.readBits(-1);
assertThrows(IOException.class, () -> bis.readBits(-1));
}
}

@Test
public void shouldNotAllowReadingOfMoreThan63BitsAtATime() throws IOException {
try (final BitInputStream bis = new BitInputStream(getStream(), ByteOrder.LITTLE_ENDIAN)) {
bis.readBits(64);
assertThrows(IOException.class, () -> bis.readBits(64));
}
}

0 comments on commit b9a9022

Please sign in to comment.