-
Notifications
You must be signed in to change notification settings - Fork 0
Feat read with read fails #15
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
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 introduces testing infrastructure to verify error handling in the read function by allowing system call injection, and improves error message clarity across the codebase.
- Adds function pointer members (
poll_,read_) to enable mocking system calls for testing - Implements new test
ReadWithReadFailthat verifies proper error handling for various errno values - Updates existing error messages for consistency and clarity (e.g., "100ms" → "100 milliseconds")
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| include/libserial/serial.hpp | Adds function pointer members and test helper method to inject mock system calls |
| src/serial.cpp | Replaces direct system calls with function pointers and improves error message formatting |
| test/test_serial_pty.cpp | Adds comprehensive error scenario testing and replaces log statements with assertions |
| test/test_ports.cpp | Removes unnecessary logging statement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Changes
Details
How to test
Screenshots/Logs (optional)
Checklist
make cppcheck/make cpplint/make uncrustifyExample(s) tested (if touched)Risks and rollbacks