Added more unit tests, test coverage reports#16
Merged
gasbytes merged 6 commits intowolfSSL:masterfrom Feb 4, 2026
Merged
Conversation
+ Fixed two corner cases when receiving RST TCP segments
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive unit test coverage and code coverage reporting capabilities to the wolfIP project. It also fixes two corner cases in RST TCP segment handling to properly handle RST packets in LISTEN and SYN_RCVD states according to RFC 793.
Changes:
- Added mock headers for wolfSSL to enable unit testing without full wolfSSL dependency
- Fixed TCP RST handling in LISTEN and SYN_RCVD states with appropriate test coverage
- Added Makefile target for code coverage reports using gcovr
- Enhanced README with structured protocol/RFC documentation table
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/wolfip.c | Fixed TCP RST handling corner cases; refactored queue_insert checks; corrected tcp_process_ts logic; reorganized ARP function variable declarations |
| src/test/unit/mocks/wolfssl/wolfcrypt/settings.h | Added mock header for wolfSSL settings to support unit testing |
| src/test/unit/mocks/wolfssl/wolfcrypt/memory.h | Added mock header for wolfSSL memory functions to support unit testing |
| src/test/unit/mocks/wolfssl/ssl.h | Added mock header for wolfSSL SSL types and functions to support unit testing |
| src/port/wolfssl_io.c | Removed extraneous blank line for code cleanup |
| src/port/stm32h563/Makefile | Changed CC and OBJCOPY assignment operators |
| README.md | Restructured protocol documentation into comprehensive table format with RFC references |
| Makefile | Added coverage build targets and platform-specific browser commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Prefer mock wolfSSL headers in unit build - Fix ICMP test frame sizing to avoid overflow - Ensure TCP ACK/TS tests use valid buffers and option lengths - Avoid tcp_process_ts infinite loop in ACK test
Co-authored-by: Copilot <[email protected]>
Spotted potential null pointer dereferences. Added specific test cases to test with null config.
gasbytes
approved these changes
Feb 4, 2026
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.
Running unit tests via
make covnow produces coverage reports.