MCPcopy
hub / github.com/google/brotli / testReadAfterEos

Method testReadAfterEos

java/org/brotli/dec/BitReaderTest.java:22–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20public class BitReaderTest {
21
22 @Test
23 public void testReadAfterEos() {
24 State reader = new State();
25 reader.input = new ByteArrayInputStream(new byte[1]);
26 Decode.initState(reader);
27 BitReader.readBits(reader, 9);
28 try {
29 BitReader.checkHealth(reader, 0);
30 } catch (BrotliRuntimeException ex) {
31 // This exception is expected.
32 return;
33 }
34 fail("BrotliRuntimeException should have been thrown by BitReader.checkHealth");
35 }
36
37 @Test
38 public void testAccumulatorUnderflowDetected() {

Callers

nothing calls this directly

Calls 4

initStateMethod · 0.95
readBitsMethod · 0.95
checkHealthMethod · 0.95
failMethod · 0.45

Tested by

no test coverage detected