Skip to content

Commit 7e0c1d4

Browse files
authored
test(http): expand http_parser.cpp coverage with 112 cases (#1014)
Covers branches not reached by the existing http_parser_test suite: URL encode/decode edge cases (percent truncation, lowercase hex, high-bit bytes), query string delimiter handling (leading/trailing '&', double '&', duplicate keys, URL-encoded delimiters), cookie malformed-pair handling, parse_request_line / parse_status_line error branches, parse_headers edge cases (multi-colon, empty value), multipart form-data edge cases (missing Content-Disposition, quoted boundary, empty field), chunked encoding boundary conditions (empty body, exact-chunk-size, multi-chunk, lowercase Content-Length removal, HTTP/1.0 fallback), byte-vector vs string_view parse parity, binary body preservation, and round-trip invariants. Follows the same pattern as tests/unit/hpack_coverage_test.cpp (#1009) and tests/unit/quic_frame_coverage_test.cpp (#1011). Static symbol verification in lieu of local build (CMake/ninja/compiler unavailable in this environment). Part of #953. Closes #1013
1 parent 87e6cfc commit 7e0c1d4

2 files changed

Lines changed: 1265 additions & 0 deletions

File tree

tests/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4703,6 +4703,14 @@ add_network_test(network_http2_client_coverage_test unit/http2_client_coverage_t
47034703
add_network_test(network_http2_client_extended_coverage_test
47044704
unit/http2_client_extended_coverage_test.cpp)
47054705

4706+
# HTTP parser extended coverage: url_encode/decode edge cases (percent
4707+
# truncation, high-bit bytes, hex case), query string delimiter handling
4708+
# (leading/trailing '&', duplicate keys, URL-encoded delimiters), cookie
4709+
# malformed-pair handling, parse_request_line / parse_status_line error
4710+
# branches, multipart form-data edge cases, chunked encoding boundary
4711+
# conditions (Issue #1013)
4712+
add_network_test(network_http_parser_coverage_test unit/http_parser_coverage_test.cpp)
4713+
47064714
# Secure transport module tests
47074715
add_network_test(network_secure_tcp_socket_module_test unit/secure_tcp_socket_test.cpp)
47084716
# secure_messaging_udp_client/server excluded: depend on dtls_socket from

0 commit comments

Comments
 (0)