Skip to content

Shared HDLC and OverAscii test vectors made from the firmware's framing code - #54

Merged
robdobsn merged 1 commit into
mainfrom
feature/comms-framing-vectors
Nov 14, 2026
Merged

robdobsn merged 1 commit into
mainfrom
feature/comms-framing-vectors

Conversation

@robdobsn

Copy link
Copy Markdown
Owner

Shared HDLC and OverAscii test vectors, made from the firmware's own framing code (MiniHDLC and ProtocolOverAscii), so the client libraries can check their framing against them.

  • scripts/tests/hdlc_vectors.json and overascii_vectors.json: CRCs, encoded frames, decoded byte streams (shared flags, junk, bad CRC, a stray escape before a flag, the frame length limit) and serial console streams (text and protocol bytes interleaved)
  • linux_unit_tests/test_comms_framing_vectors.cpp: makes the vectors again in make check and fails if they differ; also checks the RICRESTProtocol wiki examples. --write updates the files after an intended change.

raftjs's feature/comms-framing-vectors branch tests against these vectors, and raftpy's sync_vectors picks them up.

🤖 Generated with Claude Code

scripts/tests/hdlc_vectors.json and overascii_vectors.json give CRCs, encoded frames,
decoded byte streams (shared flags, junk, bad CRC, a stray escape before a flag, the
frame length limit) and serial console streams (text and protocol bytes interleaved),
all made from MiniHDLC and ProtocolOverAscii. Client libraries (raftjs, raftpy) test
their framing against them. test_comms_framing_vectors makes them again in
"make check" and fails if they differ, and checks the RICRESTProtocol wiki examples;
--write updates them after an intended change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robdobsn
robdobsn merged commit 6f6e4d7 into main Nov 14, 2026
1 check passed
@robdobsn
robdobsn deleted the feature/comms-framing-vectors branch November 14, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant