[TEST] Add comprehensive DTLS socket test coverage#416
Merged
Conversation
Implement test infrastructure and unit tests for dtls_socket class: - Add dtls_test_helpers.h with: - ssl_context_wrapper: RAII wrapper for SSL_CTX - test_certificate_generator: In-memory self-signed cert generation - dtls_context_factory: Server/client DTLS context creation - find_available_udp_port: Port discovery utility - Add test_dtls_socket.cpp with 20 test cases covering: - Construction (valid context, null context throws) - Callback registration (receive, error, endpoint) - Start/stop receive operations - Send before handshake failure - Client-server handshake - Thread safety (concurrent callbacks, endpoint access) - Send/receive after handshake - Bidirectional communication - Large payload handling - Error callback on socket close - Update CMakeLists.txt to include DTLS socket tests All 20 tests pass successfully. Closes #401
Add entry for issue #401 in both English and Korean changelogs documenting the new DTLS test infrastructure and unit tests.
Contributor
Performance ComparisonBase Branch ResultsNo base results PR Branch ResultsNo PR results |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #416 +/- ##
==========================================
+ Coverage 32.94% 33.19% +0.24%
==========================================
Files 39 39
Lines 2841 2841
==========================================
+ Hits 936 943 +7
+ Misses 1905 1898 -7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
* Add comprehensive DTLS socket test coverage Implement test infrastructure and unit tests for dtls_socket class: - Add dtls_test_helpers.h with: - ssl_context_wrapper: RAII wrapper for SSL_CTX - test_certificate_generator: In-memory self-signed cert generation - dtls_context_factory: Server/client DTLS context creation - find_available_udp_port: Port discovery utility - Add test_dtls_socket.cpp with 20 test cases covering: - Construction (valid context, null context throws) - Callback registration (receive, error, endpoint) - Start/stop receive operations - Send before handshake failure - Client-server handshake - Thread safety (concurrent callbacks, endpoint access) - Send/receive after handshake - Bidirectional communication - Large payload handling - Error callback on socket close - Update CMakeLists.txt to include DTLS socket tests All 20 tests pass successfully. Closes #401 * Update CHANGELOG for DTLS socket test coverage Add entry for issue #401 in both English and Korean changelogs documenting the new DTLS test infrastructure and unit tests.
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.
Summary
Changes
Test Infrastructure (
tests/helpers/dtls_test_helpers.h)Unit Tests (
tests/unit/test_dtls_socket.cpp)Construction Tests
Callback Registration Tests
Start/Stop Receive Tests
Handshake Tests
Thread Safety Tests
Integration Tests
Error Handling Tests
Test Results
All 20 tests pass:
Test plan
Closes #401