PE: add synthetic unit tests for implib.rs and layout.rs #894
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T13:37:55Z.
Summary
Adds 25 deterministic synthetic unit tests for
crates/victory-pe/src/implib.rs(previously 0 tests) andcrates/victory-pe/src/layout.rs(previously 1 test). Production code is unchanged after auditing both files for overflow/bounds/malformed-input handling.Because external PR creation is currently restricted (
collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:geiyiliyabumo/VIctory@test/pe-implib-and-layoutgeiyiliyabumo/VIctory@131944d(based onmainffe310e)Tests Added (Synthetic Bytes Only)
crates/victory-pe/src/implib.rs(+16 tests): named/ordinal imports, all import kinds,NAME_EXPORTAS, prefix/decoration stripping, dedup vs same-name-different-kind, cross-DLL ordering, empty archive,/&//skipped, non-import member counting, odd-size padding, non-UTF-8 names, and malformed archive/header rejection paths.crates/victory-pe/src/layout.rs(+9 tests): boundary & overflowing reads, hostilee_lfanew, directory indexing at0/15/16/usize::MAX, shortNumberOfRvaAndSizes, missing count field, directory round-trip, and PE32+ layout constants.Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --check: PASScargo xtask policy: PASS (154 files ok)cargo clippy -p victory-pe --all-targets --locked -- -D warnings: PASS (0 warnings)cargo test -p victory-pe --locked: 32 passed, 0 failedAI-assisted; synthetic tests only, no game files.