Skip to content

test(quic): expand quic_socket.cpp coverage to 70%/50% #1122

Description

@kcenon

What

Expand unit test coverage for internal/quic_socket.cpp from current 43.7% line / 21.3% branch to >=70% line / >=50% branch.

Part of #953.

Why

  • File is 439 LOC. New target identified in 2026-04-26 re-measurement.
  • Branch coverage at 21.3% means recovery and error-handling paths in QUIC socket abstraction are largely unverified.
  • v1.0 readiness gate requires >=80% line coverage ecosystem-wide (see Prepare network_system for v1.0 release #964).

Where

  • Source: internal/quic_socket.cpp (439 LOC)
  • Tests: tests/unit/internal/ (or new tests/unit/protocols/quic/quic_socket_test.cpp)

How

Approach

  1. Audit existing quic_socket tests for uncovered branches.
  2. Add tests for error paths: socket creation failure, bind failure, send/recv errors, MTU discovery edge cases.
  3. Add tests for boundary cases: max packet sizes, stateless reset, datagram extension, ECN handling.
  4. Add tests for OS-specific paths: macOS vs Linux vs Windows socket differences (where the file branches on platform).
  5. Re-run coverage workflow to verify thresholds met.

Acceptance Criteria

  • internal/quic_socket.cpp line coverage >= 70%
  • internal/quic_socket.cpp branch coverage >= 50%
  • All new tests pass on Ubuntu/macOS/Windows CI
  • All sanitizer builds (ASAN, TSAN, UBSAN) pass
  • Coverage workflow re-measurement attached as a comment on this issue

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions