Add regression tests for flash write bugs#39
Merged
Conversation
C tests (agent/test_agent.c, 5406 assertions up from 1603): - COBS trailing zero: 1000 payloads with varying CRC patterns - CRC32 high-byte shift: all 256 MSB values through pack/unpack - Proto send/recv roundtrip: 256 different payloads covering all CRC MSBs - page_is_ff: all-FF, all-00, single non-FF at every position - Sector bitmap: bit ordering, byte boundaries, all-set, all-clear Python tests (tests/test_flash_stream_regression.py, 18 tests): - COBS trailing zero: roundtrip, CRC32 with zero MSB, build/parse all patterns - Partial frame stashing: consecutive packets, extra bytes after delimiter, 32 ACKs in sequence, interleaved READY+DATA - recv_response READY timeout: verify deadline resets after READY skip - Sector bitmap: individual sectors, byte boundaries, firmware simulation - CMD_FLASH_STREAM payload: 44-byte format, bitmap parsing - COBS cross-compat: all 256 single bytes, zero CRC MSB edge case These tests prevent regressions for bugs that caused data corruption on real cameras during flash write operations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Regression tests for bugs found during hardware testing that caused data corruption on real cameras:
uint8_t << 24)_recv_packet_syncpartial frame stashrecv_responseREADY timeoutpage_is_fffalse positivesC tests: 5406 assertions (up from 1603)
Python tests: 18 new tests in
test_flash_stream_regression.pyTest plan
make -C agent test— 5406/5406 passpytest tests/test_flash_stream_regression.py— 18/18 pass🤖 Generated with Claude Code