tests: structured fuzz suite for secs2 / hsms / secsi decoders

Deterministic-seed fuzz coverage of the byte-decoding surface:

  - secs2::decode on 2000 random buffers
  - secs2::decode on every truncation of a real encoding + 500
    one-byte flips of the full encoding
  - hsms::Frame::decode on 1000 random payloads
  - hsms::Header::decode on 2000 random 10-byte buffers
  - secsi::Block::decode on 2000 random buffers
  - secs2 encode/decode round-trip identity across a battery of every
    Item factory (List, ASCII, Binary, Boolean, U1..U8, I1..I8, F4/F8,
    nested List)
  - oversize <A 3 length-bytes> length-prefix doesn't allocate GBs
  - 64-level nested List round-trip doesn't blow the stack

Contract is binary: no crash, no UB. Each decoder is allowed to throw
or return whatever; we deliberately don't assert *what* result comes
back, only that control returns. Fixed PRNG seeds make any failure
reproducible from the CI log alone.

Closes #8 in the test-gap backlog.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 10:44:42 +02:00
parent 31677d9d91
commit c527caccc5
2 changed files with 177 additions and 0 deletions
+1
View File
@@ -96,6 +96,7 @@ FetchContent_MakeAvailable(doctest)
add_executable(secsgem_tests
tests/test_main.cpp
tests/test_secs2.cpp
tests/test_fuzz.cpp
tests/test_hsms.cpp
tests/test_hsms_connection.cpp
tests/test_hsms_timers.cpp