Add comprehensive CBOR_Packet unit tests covering nested structures and realistic models#28
Closed
Copilot wants to merge 6 commits into
Closed
Add comprehensive CBOR_Packet unit tests covering nested structures and realistic models#28Copilot wants to merge 6 commits into
Copilot wants to merge 6 commits into
Conversation
Co-authored-by: polybassa <1676055+polybassa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CBOR fields similar to ASN1 fields
Add CBOR fields and packet class mirroring ASN.1 fields infrastructure
Mar 17, 2026
Co-authored-by: polybassa <1676055+polybassa@users.noreply.github.com>
Copilot stopped work on behalf of
polybassa due to an error
March 18, 2026 09:13
Owner
|
@copilot add more unit test and interoperability tests with the cbor2 library |
Copilot stopped work on behalf of
polybassa due to an error
March 18, 2026 10:27
Copilot stopped work on behalf of
polybassa due to an error
March 18, 2026 11:02
Co-authored-by: polybassa <1676055+polybassa@users.noreply.github.com>
Copilot
AI
changed the title
Add CBOR fields and packet class mirroring ASN.1 fields infrastructure
Add cbor2 interoperability tests for CBORF fields
Mar 18, 2026
Co-authored-by: polybassa <1676055+polybassa@users.noreply.github.com>
…, SEMANTIC_TAG, realistic models Co-authored-by: polybassa <1676055+polybassa@users.noreply.github.com>
Copilot
AI
changed the title
Add cbor2 interoperability tests for CBORF fields
Add comprehensive CBOR_Packet unit tests covering nested structures and realistic models
Mar 18, 2026
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.
Expands CBOR test coverage from 378 to 413 passing tests, adding 35 new tests targeting
CBOR_Packetwith complex field compositions that were previously untested or only minimally covered.New test categories
CBORF_PACKETnesting — 3-level deep nesting (ARRAY→ARRAY→ARRAY),CBORF_PACKETinsideCBORF_MAP, and the Document/Metadata nested MAP-in-MAP patternCBORF_ARRAY_OFwithCBOR_Packetelements — encode/decode/roundtrip/empty, includingCBORF_ARRAY_OFembedded in aCBORF_MAPviaCBORF_PACKETCBORF_optionaledge cases — type-mismatch sets field toNone, correct type decoded normally, behavior insideCBORF_MAPwhen key is present vs. absentCBORF_SEMANTIC_TAGextended —TEXT_STRINGinner (cbor2 decodes todatetime),INTEGERunix timestamp, tag byte major-type assertion, byte-exact comparison withcbor2.CBORTag, inside bothCBORF_MAPandCBORF_ARRAYSensorReportwith nestedCBORF_PACKETinner reading,HttpStatusList(CBORF_ARRAY_OFofCBOR_Packets), HTTP response header map, COSE-like header with negative algorithm valueNotable pitfalls documented via tests
CBORF_INTEGER.val = -7on a field defaulted to0fails at build time because the stored object isCBOR_UNSIGNED_INTEGER; feeding the negative value viacbor2.dumps(...)and dissecting it first is required:📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.