This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push:
new 9a624106e Sort members
9a624106e is described below
commit 9a624106e6a5fce948d97ee262ed5742f6e4ceb4
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Aug 22 15:23:22 2026 -0400
Sort members
---
.../compress/huffman/HuffmanDecoderTest.java | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git
a/src/test/java/org/apache/commons/compress/huffman/HuffmanDecoderTest.java
b/src/test/java/org/apache/commons/compress/huffman/HuffmanDecoderTest.java
index 1a20c8cd0..3a989c140 100644
--- a/src/test/java/org/apache/commons/compress/huffman/HuffmanDecoderTest.java
+++ b/src/test/java/org/apache/commons/compress/huffman/HuffmanDecoderTest.java
@@ -209,6 +209,18 @@ void testInvalidBitstream() throws Exception {
assertEquals("Invalid Huffman code: 62", e.getMessage());
}
+ @ParameterizedTest(name = "appending code length {1} to {0} overflows at
code length {2}")
+ @MethodSource
+ void testKraftsInequality(final int[] codeLengths, final int
extraCodeLength, final int expectedCodeLength, final int expectedLeafNodes,
+ final int expectedAvailableNodes) {
+ assertDoesNotThrow(() -> new HuffmanDecoder(codeLengths), "Code
lengths are expected to satisfy Kraft's inequality");
+ final int[] tooManyCodeLengths = ArrayUtils.add(codeLengths,
extraCodeLength);
+ final CompressorException e = assertThrows(CompressorException.class,
() -> new HuffmanDecoder(tooManyCodeLengths),
+ "Expected CompressorException for too many leaf nodes");
+ assertEquals(String.format("Tree contains too many leaf nodes for code
length %d: %d leaf nodes, but only %d nodes available", expectedCodeLength,
+ expectedLeafNodes, expectedAvailableNodes), e.getMessage());
+ }
+
@Test
void testMaxSupportedCodeLengthExceeded() {
final int[] codeLengths = new int[] {1, 1};
@@ -272,16 +284,4 @@ void testSingleCodeLength() throws Exception {
"Expected CompressorException for invalid bitstream");
assertEquals("Invalid Huffman code: 2", e.getMessage());
}
-
- @ParameterizedTest(name = "appending code length {1} to {0} overflows at
code length {2}")
- @MethodSource
- void testKraftsInequality(final int[] codeLengths, final int
extraCodeLength, final int expectedCodeLength, final int expectedLeafNodes,
- final int expectedAvailableNodes) {
- assertDoesNotThrow(() -> new HuffmanDecoder(codeLengths), "Code
lengths are expected to satisfy Kraft's inequality");
- final int[] tooManyCodeLengths = ArrayUtils.add(codeLengths,
extraCodeLength);
- final CompressorException e = assertThrows(CompressorException.class,
() -> new HuffmanDecoder(tooManyCodeLengths),
- "Expected CompressorException for too many leaf nodes");
- assertEquals(String.format("Tree contains too many leaf nodes for code
length %d: %d leaf nodes, but only %d nodes available", expectedCodeLength,
- expectedLeafNodes, expectedAvailableNodes), e.getMessage());
- }
}