PE: add synthetic unit tests for implib.rs and layout.rs #894

Closed
opened 2026-11-26 04:14:07 +00:00 by github-bot · 0 comments
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 13:37 UTC · original

Summary

Adds 25 deterministic synthetic unit tests for crates/victory-pe/src/implib.rs (previously 0 tests) and crates/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:

  • Branch: geiyiliyabumo/VIctory@test/pe-implib-and-layout
  • Commit: geiyiliyabumo/VIctory@131944d (based on main ffe310e)

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, hostile e_lfanew, directory indexing at 0/15/16/usize::MAX, short NumberOfRvaAndSizes, missing count field, directory round-trip, and PE32+ layout constants.

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check: PASS
  • cargo 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 failed

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 13:37 UTC · [original](https://github.com/Marvisak/VIctory/issues/894) ### Summary Adds 25 deterministic synthetic unit tests for `crates/victory-pe/src/implib.rs` (previously 0 tests) and `crates/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: - **Branch**: `geiyiliyabumo/VIctory@test/pe-implib-and-layout` - **Commit**: `geiyiliyabumo/VIctory@131944d` (based on `main` `ffe310e`) ### 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, hostile `e_lfanew`, directory indexing at `0`/`15`/`16`/`usize::MAX`, short `NumberOfRvaAndSizes`, missing count field, directory round-trip, and PE32+ layout constants. ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check`: **PASS** - `cargo 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 failed** *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:07 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#894
No description provided.