Skip to content

Add unit tests for HTTP/2, secure transport, and WebSocket server modules #976

Description

@kcenon

What

Add dedicated unit tests for 8 untested HTTP/2, secure transport, and WebSocket server modules. Part of #953.

Scope

Category Module Source Path
HTTP/2 hpack src/protocols/http2/hpack.cpp
HTTP/2 http2_client src/protocols/http2/http2_client.cpp
HTTP/2 http2_server src/protocols/http2/http2_server.cpp
Secure secure_tcp_socket src/internal/secure_tcp_socket.cpp
Secure secure_messaging_udp_client src/internal/secure_messaging_udp_client.cpp
Secure secure_messaging_udp_server src/internal/secure_messaging_udp_server.cpp
WebSocket websocket_client src/internal/websocket_client.cpp
WebSocket websocket_server src/internal/websocket_server.cpp

Why

  • HPACK is critical for HTTP/2 header compression — encoding/decoding bugs cause protocol failures
  • HTTP/2 client/server are the core HTTP/2 transport implementations
  • Secure transport modules handle TLS — untested TLS code is a security risk
  • WebSocket client/server are core protocol implementations
  • Part of epic Expand unit test coverage from 40% to 80% #953 to raise coverage from ~48% to 80%

Where

  • Source: src/protocols/http2/, src/internal/
  • Tests: tests/unit/ (new test files)
  • CMake: tests/CMakeLists.txt (register new tests)

How

Technical Approach

  1. HPACK: test header encoding/decoding, dynamic table management, Huffman coding
  2. HTTP/2 client/server: test connection setup, stream management, frame handling
  3. Secure sockets: test TLS handshake, certificate validation, encrypted send/receive
  4. WebSocket client/server: test connection lifecycle, message framing, close handshake

Acceptance Criteria

  • All 8 modules have dedicated unit test files
  • Tests pass on local build and CI (Ubuntu, macOS)
  • No GTEST_SKIP() markers
  • Tests cover construction, public methods, and error paths

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions