Conversation
…dules Add dedicated unit tests for core messaging (6 modules) and WebSocket (2 modules) as part of the test coverage expansion effort (epic #953). Core messaging tests (6 files): - messaging_client_test: construction, error paths, callbacks - messaging_server_test: construction, callbacks, stop behavior - messaging_udp_client_test: construction, send errors, target errors - messaging_udp_server_test: construction, callbacks, stop behavior - secure_messaging_udp_client_test: DTLS construction, verify flag, callbacks - secure_messaging_udp_server_test: DTLS construction, cert config, callbacks WebSocket tests (2 files): - messaging_ws_client_test: config defaults, send errors, callbacks - messaging_ws_server_test: config defaults, connection mgmt, broadcast Also introduces add_network_test() CMake macro to reduce boilerplate. Closes #966
4 tasks
WebSocket client/server tests already exist as test_messaging_ws_client.cpp and test_messaging_ws_server.cpp in the root tests/ directory. Remove duplicate test files and CMake entries to fix target name conflicts.
The UDP client/server classes inherit set_receive_callback from both their own interface and i_udp_client/i_udp_server, making nullptr calls ambiguous. Remove the null callback tests for these modules.
secure_messaging_udp_client/server depend on dtls_socket symbols from libs/network-udp which are not available when linking only against the main network_system library. Remove tests to fix Ubuntu linker failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Summary
Add dedicated unit tests for 8 previously untested modules: core messaging (6) and WebSocket (2). Second sub-issue of epic #953.
Change Type
Affected Components
tests/unit/— 8 new test files (1,074 lines)tests/CMakeLists.txt— 8 new test targets +add_network_test()macroWhy
Problem Solved
Core messaging and WebSocket modules had zero dedicated unit test coverage despite being primary user-facing networking APIs.
Related Issues
Where
New Test Files
Core Messaging (6 files):
messaging_client_test.cpp— TCP client: construction, error paths, callbacksmessaging_server_test.cpp— TCP server: construction, callbacks, stopmessaging_udp_client_test.cpp— UDP client: construction, send errors, target errorsmessaging_udp_server_test.cpp— UDP server: construction, callbackssecure_messaging_udp_client_test.cpp— DTLS client: verify flag, callbacks, error pathssecure_messaging_udp_server_test.cpp— DTLS server: cert config, callbacksWebSocket (2 files):
messaging_ws_client_test.cpp— config defaults, send/close errors, callbacksmessaging_ws_server_test.cpp— config defaults, connection management, broadcastHow
Implementation Details
add_network_test()CMake macro to eliminate boilerplate (~30 lines per target)Testing Done
Breaking Changes
None — new test files only