What
Expand unit test coverage for protocols/http2/http2_client.cpp from current 18.8% line / 9.9% branch to >=70% line / >=50% branch. Existing tests cover happy paths only — error paths, branch combinations, and boundary cases are largely untested.
Part of #953.
Why
Where
- Source:
protocols/http2/http2_client.cpp (576 LOC)
- Tests:
tests/unit/protocols/http2/
How
Approach
- Audit existing http2_client tests via
lcov --branch-coverage to identify uncovered branches.
- Add tests for error paths: connection refused, TLS handshake failure, HTTP/2 GOAWAY, RST_STREAM scenarios.
- Add tests for boundary cases: max stream IDs, large frame payloads, fragmented headers, flow-control window exhaustion.
- Add tests for protocol violations: malformed frames, invalid stream states, unexpected frame sequences.
- Re-run coverage workflow to verify >=70% line and >=50% branch achieved.
Acceptance Criteria
What
Expand unit test coverage for
protocols/http2/http2_client.cppfrom current 18.8% line / 9.9% branch to >=70% line / >=50% branch. Existing tests cover happy paths only — error paths, branch combinations, and boundary cases are largely untested.Part of #953.
Why
Where
protocols/http2/http2_client.cpp(576 LOC)tests/unit/protocols/http2/How
Approach
lcov --branch-coverageto identify uncovered branches.Acceptance Criteria
protocols/http2/http2_client.cppline coverage >= 70%protocols/http2/http2_client.cppbranch coverage >= 50%