Skip to content

Commit 969af9e

Browse files
authored
test(http2): add client coverage test for #991 (#998)
Expand unit coverage of src/protocols/http2/http2_client.cpp via a new tests/unit/http2_client_coverage_test.cpp with 39 focused tests: - connect() guard clauses: empty host and empty host on default port - connect() network error paths: unreachable port, invalid hostname, and TLS handshake failure against a plain-TCP listener - disconnect() idempotency: no-op before connect, multiple calls, disconnect after a failed connect - Destructor paths: fresh instance, after failed connect, after explicit disconnect - set_settings() propagation: small/large/zero header_table_size, enable_push toggle, all fields changed at once - set_timeout() edge values: very large, negative, persistence across failed connect - Disconnected request/stream operations (expanded): get/post/put/del with headers and bodies, start_stream, write_stream with end_stream, close_stream_writer, cancel_stream, empty path - http2_response: case-insensitive header lookup, duplicate-header order, empty-header lookup, binary body preservation, large body - http2_stream: move semantics preserving buffers, default callbacks empty, move assignment preserving streaming flag - stream_state: all pairs distinct Tests avoid any reliance on a live HTTP/2 peer; a local plain-TCP listener drives the TLS handshake failure branch. Relates to #991
1 parent 3532a5d commit 969af9e

2 files changed

Lines changed: 643 additions & 0 deletions

File tree

tests/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4677,6 +4677,10 @@ add_network_test(network_http2_server_module_test unit/http2_server_test.cpp)
46774677
# connection preface handling via raw TCP clients (Issue #992)
46784678
add_network_test(network_http2_server_coverage_test unit/http2_server_coverage_test.cpp)
46794679

4680+
# HTTP/2 client extended coverage: connect guard clauses, network error paths,
4681+
# settings/timeout edge cases, disconnected request/stream operations (Issue #991)
4682+
add_network_test(network_http2_client_coverage_test unit/http2_client_coverage_test.cpp)
4683+
46804684
# Secure transport module tests
46814685
add_network_test(network_secure_tcp_socket_module_test unit/secure_tcp_socket_test.cpp)
46824686
# secure_messaging_udp_client/server excluded: depend on dtls_socket from

0 commit comments

Comments
 (0)