Conversation
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
|
Unit-test error generated by Valgrind: GIVEN A specified EOP byte of 0x00 UPDATE: |
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.
No description provided.