Skip to content

test(facade): add QUIC facade tests and expand TCP facade coverage#958

Merged
kcenon merged 1 commit intomainfrom
test/issue-955-facade-adapter-tests
Apr 13, 2026
Merged

test(facade): add QUIC facade tests and expand TCP facade coverage#958
kcenon merged 1 commit intomainfrom
test/issue-955-facade-adapter-tests

Conversation

@kcenon
Copy link
Copy Markdown
Owner

@kcenon kcenon commented Apr 13, 2026

What

Summary

Add comprehensive unit tests for the QUIC facade (the only facade missing a dedicated test file) and significantly expand TCP facade test coverage with server creation, connection pool, SSL validation, interface conformance, and guard path tests.

Change Type

  • Test

Affected Components

  • tests/test_quic_facade.cpp - New QUIC facade test file (53 test cases)
  • tests/test_tcp_facade.cpp - Expanded from 4 to 24+ test cases
  • tests/CMakeLists.txt - Register QUIC facade test target

Why

Related Issues

Motivation

All five protocol facades (TCP, UDP, HTTP, WebSocket, QUIC) had existing tests except QUIC, which had no dedicated test file. TCP facade tests were sparse (only validation tests). This PR closes those coverage gaps by:

  1. Creating test_quic_facade.cpp with full coverage of QUIC-specific features (ALPN, mutual TLS, 0-RTT, idle timeout, max connections)
  2. Expanding TCP facade tests with server creation, connection pool, SSL validation, interface conformance, guard paths, and callback tests

How

Implementation Details

QUIC Facade Tests (test_quic_facade.cpp):

  • Client config validation (empty host, port zero, zero idle timeout)
  • Server config validation (port zero, empty cert/key paths, zero idle timeout, zero max connections)
  • Client creation with various configurations (ALPN, CA cert, mutual TLS, custom timeout, 0-RTT)
  • Server creation with various configurations (custom ID, ALPN, mutual TLS, custom max connections)
  • Interface conformance (returned objects implement i_protocol_client/i_protocol_server)
  • Guard paths (send on unconnected client, stop before start, connection count before start)
  • Edge cases (port boundaries 1 and 65535, minimal idle timeout, minimal max connections)
  • Callback setup (verify callbacks can be set before start without crashing)

TCP Facade Tests (expanded test_tcp_facade.cpp):

  • Server creation (basic, custom ID, auto-generated ID, multiple servers)
  • SSL not-implemented errors (server and client)
  • Connection pool (creation, validation errors for empty host/port zero/pool size zero)
  • Interface conformance (server returns i_protocol_server)
  • Guard paths (connection count, stop before start, callback setup)
  • SSL validation (missing cert, missing key, empty cert, empty key)
  • Zero timeout validation

Test Plan

  1. Tests follow existing project patterns (GTest fixtures, Result assertions)
  2. No network connections required - tests validate configuration, creation, and guard paths
  3. CI will verify compilation and test execution across all platforms

Checklist

  • Tests follow project conventions
  • No sensitive data exposed
  • CMakeLists.txt updated with new test target
  • Related issue linked

Add comprehensive unit test file for QUIC facade (test_quic_facade.cpp)
covering client/server config validation, creation, interface conformance,
guard paths, edge cases, and callback setup. Expand TCP facade tests with
server creation, connection pool, SSL validation, interface conformance,
guard paths, and callback tests. Register QUIC facade test target in
CMakeLists.txt.
@github-actions
Copy link
Copy Markdown
Contributor

Performance Comparison

Base Branch Results

No base results

PR Branch Results

No PR results

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Metric Value
Line Coverage 62.4%
Target 75% (stretch: 80%)
Coverage Details

Full HTML report is available as a build artifact.

@kcenon kcenon merged commit ea816d5 into main Apr 13, 2026
39 checks passed
@kcenon kcenon deleted the test/issue-955-facade-adapter-tests branch April 13, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant