Skip to content

Commit 7d245fb

Browse files
test(serdes): add Wave 4 complex scenario tests
Add comprehensive complex scenario tests for DSDL serialization: Task 10 - Non-byte-aligned primitive arrays (7 tests): - bool[N] arrays with LSB-first bit packing - uint3[4], uint5[3] sub-byte arrays - Variable-length sub-byte arrays - Mixed sub-byte struct {uint3, bool, uint5} - Verified bit patterns: bool[8] [T,F,T,F,T,F,T,F] → 0x55 Task 11 - Union variant scaling + tag width (6 tests): - Union tag width boundaries: 256 variants → 8-bit, 257 → 16-bit - Tag width formula verification: 2^ceil(log2(max(8, (n-1).bit_length()))) - Roundtrip all variants for small unions {3, 4} - Roundtrip variant 0 and max for large unions {256, 257} Task 12 - Complex nested type roundtrips (8 tests): - Deep nesting: 3-level and 4-level struct→struct→struct - Arrays of composites: struct[N], union[N] - Union with struct variants - Mixed patterns: struct→union→struct, struct→array→struct - Complex combined nesting Task 13 - Mixed alignment, defaults, API edge cases (10 tests): - Mixed alignment: byte + sub-byte fields (bit-packed) - Alignment rules: primitives=1 (bit-packed), composites=8 (byte-aligned) - Default value handling: all defaults, partial defaults - API edge cases: empty struct, single-field struct, single-variant union - Type coercions: int→float, list→tuple - Error handling: invalid types, out-of-range values All 309 tests pass (91 original + 218 new).
1 parent c7172c1 commit 7d245fb

1 file changed

Lines changed: 875 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)