MCPcopy Index your code
hub / github.com/google/brotli / checkSynth

Method checkSynth

java/org/brotli/dec/SynthTest.java:43–56  ·  view source on GitHub ↗
(byte[] compressed, boolean expectSuccess, String expectedOutput)

Source from the content-addressed store, hash-verified

41 }
42
43 private void checkSynth(byte[] compressed, boolean expectSuccess, String expectedOutput) {
44 byte[] expected = readUniBytes(expectedOutput);
45 try {
46 byte[] actual = decompress(compressed);
47 if (!expectSuccess) {
48 fail("expected to fail decoding, but succeeded");
49 }
50 assertArrayEquals(expected, actual);
51 } catch (IOException ex) {
52 if (expectSuccess) {
53 throw new AssertionError("expected to succeed decoding, but failed", ex);
54 }
55 }
56 }
57
58 private static String times(int count, String str) {
59 StringBuilder out = new StringBuilder(count * str.length());

Calls 3

decompressMethod · 0.95
readUniBytesMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected