test(#430): fix oversized-frame test for the 176-byte ceiling

The 172->176 ceiling raise made the existing "drops oversized frames and
resyncs" test's 173-byte frame a valid length, so it buffered instead of
dropping (it was red). Derive the over-max length from the ceiling so it stays
a genuine oversized frame and still exercises drop-and-resync, confirming the
higher ceiling doesn't weaken corrupt-frame recovery. Full suite: 643 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fix/395-dm-channel-send-wedge
Strycher 2 months ago
parent ed8bfdf503
commit 128bc9996c

@ -102,11 +102,16 @@ void main() {
() {
final decoder = UsbSerialFrameDecoder();
// A frame claiming a payload above the max must be dropped, and the
// decoder must resync to the next valid frame. Length is derived from the
// ceiling so this stays a genuine over-max after it was raised to 176
// (#430) — a hard-coded 173 is now a valid length.
final oversized = usbSerialMaxPayloadLength + 1;
final packets = decoder.ingest(
Uint8List.fromList(<int>[
usbSerialRxFrameStart,
0xAD,
0x00,
oversized & 0xff,
(oversized >> 8) & 0xff,
0x99,
usbSerialRxFrameStart,
0x01,

Loading…
Cancel
Save

Powered by TurnKey Linux.