Skip to content

Add unit tests for core messaging and WebSocket modules #966

@kcenon

Description

@kcenon

What

Add dedicated unit tests for 8 untested modules: core messaging (6) and HTTP/WebSocket (2). Part of #953.

Scope

Category Modules Files
Core Messaging 6 messaging_client.cpp, messaging_server.cpp, messaging_udp_client.cpp, messaging_udp_server.cpp, secure_messaging_udp_client.cpp, secure_messaging_udp_server.cpp
HTTP/WebSocket 2 websocket_client.cpp, websocket_server.cpp

Why

  • Core messaging modules are the primary user-facing networking APIs with 0% dedicated test coverage
  • WebSocket client/server lack unit tests despite being production-ready features
  • These modules handle connection lifecycle, message routing, and error handling — high regression risk
  • Part of epic Expand unit test coverage from 40% to 80% #953 to raise coverage from 48% to 80%

Where

  • Source: src/core/, src/http/
  • Tests: tests/unit/ (new test files)
  • CMake: tests/CMakeLists.txt (register new tests)

How

Technical Approach

  1. Create unit test files following existing patterns (see secure_messaging_client_test.cpp as reference)
  2. Use GTest with mock/stub patterns for network I/O where needed
  3. Test construction, configuration, connection lifecycle, and error paths
  4. Register tests in tests/CMakeLists.txt

Acceptance Criteria

  • All 8 modules have dedicated unit test files
  • Tests pass on local build
  • No GTEST_SKIP() markers
  • Tests cover constructors, public methods, and error handling

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions