PE tests: cover ImportLibrary::parse short imports and archive errors #1814

Open
github-bot wants to merge 1 commit from github-bot/gh-1814 into main AGit
Owner

@⁠n-romanovich on GitHub · 2026-11-24 22:57 UTC · original
n-romanovich:test/pe-implib → main · +44 −0 · 1 files · 1 commits · open

Adds synthetic COFF archive unit tests in crates/victory-pe/src/implib.rs covering Code/Data/Const short imports, named and ordinal exports, sorting/deduplication, other_members counting, and invalid archive rejection.

AI-assisted; verified with rustfmt --check, cargo clippy -p victory-pe --all-targets --locked -- -D warnings, and cargo test -p victory-pe --locked (9 passed).

**@⁠n-romanovich** on GitHub · 2026-11-24 22:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/1814) `n-romanovich:test/pe-implib` → `main` · +44 −0 · 1 files · 1 commits · open Adds synthetic COFF archive unit tests in `crates/victory-pe/src/implib.rs` covering `Code`/`Data`/`Const` short imports, named and ordinal exports, sorting/deduplication, `other_members` counting, and invalid archive rejection. AI-assisted; verified with `rustfmt --check`, `cargo clippy -p victory-pe --all-targets --locked -- -D warnings`, and `cargo test -p victory-pe --locked` (9 passed).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:45:31 +00:00
Author
Owner

@⁠DesertGamer on GitHub · 2026-11-24 23:07 UTC · original

VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

**@⁠DesertGamer** on GitHub · 2026-11-24 23:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/1814#issuecomment-7147037525) ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
Author
Owner

@⁠Headache3318 on GitHub · 2026-11-25 01:28 UTC · original

Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned by rust-toolchain.toml). PR head 32ad8f6 applied cleanly onto current main ccfb029.

  • cargo test -p victory-pe --locked: 2 implib tests passed (the 4 image tests fail on Linux as expected, parsing the test binary as a PE); total 5 passed.
  • cargo clippy -p victory-pe --all-targets --locked -- -D warnings: clean.

Not tested: Windows MSVC build, the title itself. AI-assisted.

**@⁠Headache3318** on GitHub · 2026-11-25 01:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/1814#issuecomment-7149586364) Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned by `rust-toolchain.toml`). PR head `32ad8f6` applied cleanly onto current `main` `ccfb029`. - `cargo test -p victory-pe --locked`: 2 implib tests passed (the 4 `image` tests fail on Linux as expected, parsing the test binary as a PE); total 5 passed. - `cargo clippy -p victory-pe --all-targets --locked -- -D warnings`: clean. Not tested: Windows MSVC build, the title itself. AI-assisted.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:36 UTC · original · edited 2026-11-25 07:18 UTC

Automated triage for the maintainers.

Proposed close: already covered in main. Update after your reply: thanks for dropping the duplicate helpers. Both of the new tests in crates/victory-pe/src/implib.rs repeat cases that main's mod tests already checks:

  • malformed_short_import_counts_as_other_member: members_that_are_not_import_objects_are_counted already has a short.lib/ member, an import_object truncated to 24 bytes, and asserts that it lands in other_members.
  • named_import_normalizes_hint_to_zero: parses_named_code_imports already builds ExitProcess with hint 7 and asserts hint: 0, with a comment explaining why.

A test for a path ImportLibrary::parse does not cover yet would change the verdict. One example is a member whose ArchiveFile data cannot be read, so the ? propagates an error.

CI: passing (check).

This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/1814#issuecomment-7149750402) · edited 2026-11-25 07:18 UTC <!-- victory-triage v1 head=8e6b1162d29bb0f908583ce0d9cb7b9ead9adc09 verdict=proposed-close at=2026-11-25T07:18:47Z --> Automated triage for the maintainers. **Proposed close: already covered in main.** Update after your reply: thanks for dropping the duplicate helpers. Both of the new tests in `crates/victory-pe/src/implib.rs` repeat cases that `main`'s `mod tests` already checks: - `malformed_short_import_counts_as_other_member`: `members_that_are_not_import_objects_are_counted` already has a `short.lib/` member, an `import_object` truncated to 24 bytes, and asserts that it lands in `other_members`. - `named_import_normalizes_hint_to_zero`: `parses_named_code_imports` already builds `ExitProcess` with hint 7 and asserts `hint: 0`, with a comment explaining why. A test for a path `ImportLibrary::parse` does not cover yet would change the verdict. One example is a member whose `ArchiveFile` data cannot be read, so the `?` propagates an error. CI: passing (`check`). This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-25 01:45 UTC · original

@⁠Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.

**@⁠n-romanovich** on GitHub · 2026-11-25 01:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1814#issuecomment-7149930130) @⁠Marvisak, rebased onto the current main and resolved the conflict in crates/victory-gpu/src/descriptor/host.rs.
Author
Owner

@⁠n-romanovich on GitHub · 2026-11-25 06:43 UTC · original

@⁠Marvisak, updated test/pe-implib (8e6b116):

  • Removed the duplicate push_member / short_import helpers and the tests already covered in main.
  • Added two tests using main's archive / import_object helpers for cases ImportLibrary::parse didn't cover yet:
    • malformed_short_import_counts_as_other_member: verifies a truncated short-import header increments other_members instead of failing ImportLibrary::parse.
    • named_import_normalizes_hint_to_zero: verifies named imports normalize a non-zero ordinal_or_hint to hint: 0.
**@⁠n-romanovich** on GitHub · 2026-11-25 06:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/1814#issuecomment-7155087704) @⁠Marvisak, updated `test/pe-implib` (`8e6b116`): - Removed the duplicate `push_member` / `short_import` helpers and the tests already covered in `main`. - Added two tests using `main`'s `archive` / `import_object` helpers for cases `ImportLibrary::parse` didn't cover yet: - `malformed_short_import_counts_as_other_member`: verifies a truncated short-import header increments `other_members` instead of failing `ImportLibrary::parse`. - `named_import_normalizes_hint_to_zero`: verifies named imports normalize a non-zero `ordinal_or_hint` to `hint: 0`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1814/head:github-bot/gh-1814'
git switch 'github-bot/gh-1814'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1814'
git switch 'github-bot/gh-1814'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1814'
git switch 'github-bot/gh-1814'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1814'
git switch 'main'
git merge --squash 'github-bot/gh-1814'
git switch 'main'
git merge --ff-only 'github-bot/gh-1814'
git switch 'main'
git merge 'github-bot/gh-1814'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!1814
No description provided.