-
Notifications
You must be signed in to change notification settings - Fork 14
chore: Test COBS functions #219
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
Adds Catch2 unit coverage for COBS helper functions and adjusts COBS sizing helpers to better handle edge cases (notably zero-length inputs) and centralize constants.
Changes:
- Added new Catch2 test suites covering
_cobsDecode,_cobsEncode,_cobsEncodedLength,_cobsEncodedMaxLength, and_cobsGuaranteedFit. - Registered the new COBS tests in the test CMake target list.
- Updated
n_cobs.cto introduceCOBS_MAX_PACKET_SIZEand revise_cobsEncodedMaxLength/_cobsGuaranteedFitcalculations.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test/src/_cobsGuaranteedFit_test.cpp | Adds unit tests for _cobsGuaranteedFit across boundary conditions. |
| test/src/_cobsEncodedMaxLength_test.cpp | Adds unit tests for _cobsEncodedMaxLength, including length=0. |
| test/src/_cobsEncodedLength_test.cpp | Adds unit tests for _cobsEncodedLength correctness and input immutability. |
| test/src/_cobsEncode_test.cpp | Adds unit tests for _cobsEncode, including in-place encoding and non-zero EOP. |
| test/src/_cobsDecode_test.cpp | Adds unit tests for _cobsDecode, including in-place decoding and non-zero EOP. |
| test/CMakeLists.txt | Registers the new COBS unit test executables with CTest discovery. |
| n_cobs.c | Centralizes max packet size constant and updates worst-case sizing/fit computations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Unit-test error generated by Valgrind: GIVEN A specified EOP byte of 0x00 UPDATE: |
No description provided.