Skip to content

Commit 6947e33

Browse files
authored
test(http2/hpack): expand coverage for hpack.cpp (#1044)
* test(http2/hpack): add extra coverage suite for issue #1031 Adds tests/unit/hpack_extra_coverage_test.cpp closing remaining gaps after hpack_test.cpp and hpack_coverage_test.cpp: - Static table boundary entries (index 61, name-only lookup ordering, mismatched-value fall-through) - Dynamic table get() past entry_count, growing max_size without eviction, full-match preference over name-only match - Encoder static-name-mismatched-value path forcing literal-with-indexing via static name reference - Decoder happy paths for literal-without-indexing (0x00) new-name and indexed-name forms, never-indexed (0x10) prefix, and multi-header blocks - Multi-byte integer decoding under the 64-bit overflow threshold - Huffman stub encoded_size and byte-for-byte round-trip contract lock - Encoder/decoder pair convergence for static-only emissions and mixed static/dynamic flows Each decoder-path test builds wire bytes by hand against RFC 7541 §6 so the decoder is the unit under test, not the encoder upstream of it. * docs(changelog): note hpack extra coverage tests for #1031
1 parent c76aa72 commit 6947e33

4 files changed

Lines changed: 431 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4040
- Add `message_validator_extended_test` for extended message validation edge cases
4141
- Add `sliding_histogram_test` for `sliding_histogram` statistics and percentile calculations
4242
- Update Codecov configuration to track unit and integration coverage separately
43+
- Expand HPACK (`src/protocols/http2/hpack.cpp`) unit coverage with `hpack_extra_coverage_test` — closes static-table boundary lookups, decoder happy paths for literal-without-indexing / never-indexed prefixes, multi-byte integer non-overflow path, huffman stub contract, and mixed static/dynamic round-trips ([#1031](https://github.com/kcenon/network_system/issues/1031))
4344

4445
### Added
4546

docs/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3535
- Internal (1): `websocket_socket`
3636
- Registered all 11 test targets in `tests/CMakeLists.txt`
3737
- Part of the #953 coverage expansion effort targeting 48% to 80% unit test coverage
38+
- **Additional HPACK coverage tests (#1031)**
39+
- Added `tests/unit/hpack_extra_coverage_test.cpp` complementing `hpack_test.cpp` (Issue #976) and `hpack_coverage_test.cpp` (Issue #1009)
40+
- Closes static-table boundary lookups (index 61, name-only ordering, mismatched-value fall-through), dynamic-table get-past-end and grow-without-eviction paths, encoder static-name-mismatched-value forcing literal-with-indexing path, decoder happy paths for literal-without-indexing (`0x00`) new-name and indexed-name forms plus never-indexed (`0x10`) prefix, multi-byte integer decoding under the 64-bit overflow threshold, huffman stub `encoded_size` and byte-for-byte round-trip contract, and encoder/decoder pair convergence for static-only emissions
41+
- Registered `network_hpack_extra_coverage_test` in `tests/CMakeLists.txt`
42+
- Part of the #953 coverage expansion effort, targeting `src/protocols/http2/hpack.cpp` line >= 70% / branch >= 60%
3843
- **Modernized Doxygen Documentation with doxygen-awesome-css (#927)**
3944
- Vendored doxygen-awesome-css theme with dark mode toggle, code copy buttons, and responsive sidebar
4045
- Added custom header (`docs/header.html`) and branding CSS (`docs/custom.css`)

tests/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4838,6 +4838,12 @@ add_network_test(network_hpack_module_test unit/hpack_test.cpp)
48384838
# integer-length boundary round-trips (Issue #1009)
48394839
add_network_test(network_hpack_coverage_test unit/hpack_coverage_test.cpp)
48404840

4841+
# HPACK additional coverage: static-table boundary entries, decoder happy paths
4842+
# for literal-without-indexing / never-indexed prefixes, multi-byte integer
4843+
# non-overflow path, huffman stub contract, mixed static/dynamic round-trips
4844+
# (Issue #1031)
4845+
add_network_test(network_hpack_extra_coverage_test unit/hpack_extra_coverage_test.cpp)
4846+
48414847
add_network_test(network_http2_client_module_test unit/http2_client_test.cpp)
48424848
add_network_test(network_http2_server_module_test unit/http2_server_test.cpp)
48434849

0 commit comments

Comments
 (0)