-
Notifications
You must be signed in to change notification settings - Fork 0
Feat improve tests #17
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
…from the termios2 structure directly
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
This PR improves test coverage and refactors system call injection mechanisms for better testability. The changes focus on enhancing the serial port library's testing infrastructure by splitting system call function setters and adding new error injection tests.
Key changes:
- Split
setSystemCallFunctionsinto separatesetPollSystemFunction,setReadSystemFunction, andsetIoctlSystemFunctionmethods for more granular test control - Added
SetTermios2WithFailtest to verify error handling in ioctl operations - Implemented
getDataLength()method to retrieve current data length configuration - Removed unused
data_length_member variable in favor of reading directly from terminal options
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/test_serial_pty.cpp | Added new failure injection test for setTermios2; updated existing tests to use split system call setters; added commented-out data length test |
| src/serial.cpp | Replaced direct ioctl calls with ioctl_ wrapper; implemented getDataLength() method; removed unnecessary assignments in setDataLength() |
| include/libserial/serial.hpp | Split system call injection into separate methods; added ioctl_ function wrapper; removed data_length_ member variable; added getDataLength() declaration |
💡 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 3 out of 3 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 3 out of 3 changed files in this pull request and generated 3 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 uncrustifyRisks and rollbacks