Commit 969af9e
authored
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4677 | 4677 | | |
4678 | 4678 | | |
4679 | 4679 | | |
| 4680 | + | |
| 4681 | + | |
| 4682 | + | |
| 4683 | + | |
4680 | 4684 | | |
4681 | 4685 | | |
4682 | 4686 | | |
| |||
0 commit comments