aboutsummaryrefslogtreecommitdiff
path: root/java/org/brotli/dec/BitReaderTest.java
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas@google.com>2017-04-05 18:50:01 +0200
committerGitHub <noreply@github.com>2017-04-05 18:50:01 +0200
commit21c118ba776a1e93a30397bdd66636a6f3c0b06b (patch)
tree8eb99646dd4a1b5cca9cc02eb1c5fe33dce10514 /java/org/brotli/dec/BitReaderTest.java
parente12a7a2d2859809c25b1941cf48ef17d55514efd (diff)
downloadbrotli-21c118ba776a1e93a30397bdd66636a6f3c0b06b.zip
brotli-21c118ba776a1e93a30397bdd66636a6f3c0b06b.tar.gz
brotli-21c118ba776a1e93a30397bdd66636a6f3c0b06b.tar.bz2
Update c- and java-decoder: (#536)
* speedup java decoder * avoid masking * avoid excessive fillBits * streamline uncompressed block processing * make java decoder more transpilation-friendly * avoid non-essential goto in c-decoder
Diffstat (limited to 'java/org/brotli/dec/BitReaderTest.java')
-rwxr-xr-xjava/org/brotli/dec/BitReaderTest.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/java/org/brotli/dec/BitReaderTest.java b/java/org/brotli/dec/BitReaderTest.java
index 9577c62..bc76ce1 100755
--- a/java/org/brotli/dec/BitReaderTest.java
+++ b/java/org/brotli/dec/BitReaderTest.java
@@ -6,6 +6,8 @@
package org.brotli.dec;
+import static org.junit.Assert.fail;
+
import java.io.ByteArrayInputStream;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -17,11 +19,17 @@ import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class BitReaderTest {
- @Test(expected = BrotliRuntimeException.class)
+ @Test
public void testReadAfterEos() {
BitReader reader = new BitReader();
BitReader.init(reader, new ByteArrayInputStream(new byte[1]));
BitReader.readBits(reader, 9);
- BitReader.checkHealth(reader);
+ try {
+ BitReader.checkHealth(reader, false);
+ } catch (BrotliRuntimeException ex) {
+ // This exception is expected.
+ return;
+ }
+ fail("BrotliRuntimeException should have been thrown by BitReader.checkHealth");
}
}