tests: cover x2w_save_pack layout, overflow guards, and serialization #3748
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3748
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3746"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Ammmae0x on GitHub · 2026-12-01 14:23 UTC · original
Ammmae0x:tests/save-blob-pack-unit→main· +1021 −0 · 5 files · 1 commits · merged 2026-12-01 17:04 UTCRefs #1149.
Portable C++17 unit, overflow-boundary, layout, and 1:1 header-mutation tests for
x2w_save_pack(src/startup_stubs/save_blob_pack.h), with zero edits to existing files (5 new files only). The new check uses the disjointsave_blob_pack_unitprefix so test names do not collide withstartup_save_blob_pack.What landed (commit
e1204e30):tests/save_blob_pack_unit_check.cpp: 22 cases, pure C++17, no<windows.h>. Layout (sizeof(Blob) == 24,offsetof(Blob, data) == 16,BlobInfolayout); bothbytes_neededoverloads (empty inputs setoutto 0, exact formulacount*24 + sum(name.size() + 1 + bytes.size()), record-table count overflow, null sizes pointer,UINT32_MAXpayload accepted vsUINT32_MAX + 1refused, thename_bytes >= SIZE_MAX - data_bytesNUL-room boundary and the exactSIZE_MAXfit one below it, extra overflow by one, aSIZE_MAXpayload, and a two-piece cumulative overflow, each refusal leavingoutunchanged);write()serialization (empty write leaves the buffer untouched, empty name with zero-byte payload, binary payload with embedded NULs, three-piece mix, name with an embedded NUL), verifying exact NUL-terminated strings, pointer offsets insidedest,info.size, guard bytes, and an end cursor equal tobytes_needed.tests/cmake/save_blob_pack_unit.cmake: per-case CTests plussave_blob_pack_unit_alland 6WILL_FAIL TRUEheader-copy controls (u32_cap,name_nul_guard,extra_overflow_guard,write_nul,write_info_size,add_accumulate) with mutated copies understartup_stubs/save_blob_pack.handBEFORE PRIVATEinclude.tests/save_blob_pack_unit_meta_check.py,tests/checks/python-linux/save_blob_pack_unit.txt,docs/experiments/save-blob-pack-unit.md.Linux checks (this host,
g++ -std=c++17):Scratch CMake + CTest: 29/29 (22 cases,
save_blob_pack_unit_all, 6 mutation controls). Form, docs (208 files / 802 links), and bidi (2827 files) checks pass; parallel Python runner 299/299;diff --checkclean; merge-tree vsorigin/mainexits 0.No mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter.
AI-assisted.
Windows Verification (
e1204e30)git merge-tree --write-tree upstream/main HEAD->8aa64c9d(exit 0),git diff --checkcleanpy_compile,form_coverage_check.py,docs_links_check.py(209 files, 806 links),bidi_controls_check.py(2830 files) passeddev29/29 passed (0.95s);release29/29 passed (0.95s);save_blob_pack_unit_check:PASS: save_blob_pack_unit: 22/22 cases passed. AI-assisted.