-
Notifications
You must be signed in to change notification settings - Fork 18
Added more unit tests, test coverage reports #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
+ Fixed two corner cases when receiving RST TCP segments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Running unit tests via
make covnow produces coverage reports.