HLE: add synthetic unit tests for storage.rs and host.rs #1193

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

@⁠geiyiliyabumo on GitHub · 2026-11-24 16:23 UTC · original
geiyiliyabumo:test/hle-storage-and-host → main · +355 −26 · 2 files · 1 commits · open

Summary

Closes #942

Full verification details and change notes are documented in #942 (commit 62abb60, based on main ffe310e).

 crates/victory-hle/src/host.rs            | 138 +++++++++++++++++
 crates/victory-hle/src/modules/storage.rs | 243 ++++++++++++++++++++++++++----
 2 files changed, 355 insertions(+), 26 deletions(-)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

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

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 16:23 UTC · [original](https://github.com/Marvisak/VIctory/pull/1193) `geiyiliyabumo:test/hle-storage-and-host` → `main` · +355 −26 · 2 files · 1 commits · open ### Summary Closes #942 Full verification details and change notes are documented in #942 (commit `62abb60`, based on `main` `ffe310e`). ```text crates/victory-hle/src/host.rs | 138 +++++++++++++++++ crates/victory-hle/src/modules/storage.rs | 243 ++++++++++++++++++++++++++---- 2 files changed, 355 insertions(+), 26 deletions(-) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:23:08 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:00 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 62abb60: cargo test -p victory-hle passes, 105 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1193#issuecomment-7140020019) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 62abb60: `cargo test -p victory-hle` passes, 105 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:26 UTC · original

Automated triage for the maintainers.

Merge candidate. This is tests only, plus Default on SpaceInfo:

  • In crates/victory-hle/src/modules/storage.rs, it adds tests for the drive-root path and its NUL, E_FAIL on a short buffer with nothing written, NOT_SUPPORTED before a title is set, and recursive used_bytes. It also covers quota and free-space reporting (including over-quota and a missing folder) and the space prompt's bounds. A module-local lock serialises the tests that set the process-wide title; storage.rs is the only test module that calls runtime::set_title.
  • In crates/victory-hle/src/host.rs, it adds tests for HostPolicy matching (case, * prefix, look-alike names) and resolution through GetProcAddress.

I checked each assertion against main's path, path_size, space and prompt_for_space, and they match the documented behaviour in those functions. One note for the maintainer: the_default_policy_is_an_allow_list lists the default allow list name by name, including ws2_32.dll, winhttp.dll and iphlpapi.dll. Any future change to that list will need this test updated too, which is arguably the point.

CI: no check runs on the head commit. A reviewer reports cargo test -p victory-hle passing (105 tests).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/1193#issuecomment-7149547941) <!-- victory-triage v1 head=62abb6071a7dcc72d2fd07f1f8b01d7efaf461d0 verdict=merge-candidate at=2026-11-25T01:26:24Z --> Automated triage for the maintainers. **Merge candidate.** This is tests only, plus `Default` on `SpaceInfo`: - In `crates/victory-hle/src/modules/storage.rs`, it adds tests for the drive-root path and its NUL, `E_FAIL` on a short buffer with nothing written, `NOT_SUPPORTED` before a title is set, and recursive `used_bytes`. It also covers quota and free-space reporting (including over-quota and a missing folder) and the space prompt's bounds. A module-local lock serialises the tests that set the process-wide title; `storage.rs` is the only test module that calls `runtime::set_title`. - In `crates/victory-hle/src/host.rs`, it adds tests for `HostPolicy` matching (case, `*` prefix, look-alike names) and resolution through `GetProcAddress`. I checked each assertion against `main`'s `path`, `path_size`, `space` and `prompt_for_space`, and they match the documented behaviour in those functions. One note for the maintainer: `the_default_policy_is_an_allow_list` lists the default allow list name by name, including `ws2_32.dll`, `winhttp.dll` and `iphlpapi.dll`. Any future change to that list will need this test updated too, which is arguably the point. CI: no check runs on the head commit. A reviewer reports `cargo test -p victory-hle` passing (105 tests). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 01:02 UTC · original

Code review and Windows 11 verification at head 62abb6071a7d merged cleanly onto main (63bcca43c6a0):

  • Code & concurrency audit (crates/victory-hle/src/host.rs:150-289, storage.rs:164-431):
    • Purely synthetic inputs and isolated tempfile::tempdir() instances (no external paths or game files). Verified storage::tests is the sole caller of runtime::set_title across the repo and every such test acquires TITLE_TESTS, so parallel execution is race-free.
  • Verified (Windows 11, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy -p victory-hle --all-targets --locked -- -D warnings (default + --all-features): 0 warnings
    • cargo test -p victory-hle --locked (default + --all-features): 162/162 lib + 1 subprocess + fidelityfx + no_dll_planting passed; parallel --test-threads=8 re-run of modules::storage::tests (8/8) and host::tests (3/3) passed cleanly.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 01:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/1193#issuecomment-7179376643) Code review and Windows 11 verification at head `62abb6071a7d` merged cleanly onto `main` (`63bcca43c6a0`): - **Code & concurrency audit (`crates/victory-hle/src/host.rs:150-289`, `storage.rs:164-431`)**: - Purely synthetic inputs and isolated `tempfile::tempdir()` instances (no external paths or game files). Verified `storage::tests` is the sole caller of `runtime::set_title` across the repo and every such test acquires `TITLE_TESTS`, so parallel execution is race-free. - **Verified (Windows 11, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` (default + `--all-features`): 0 warnings - `cargo test -p victory-hle --locked` (default + `--all-features`): **162/162 lib + 1 subprocess + `fidelityfx` + `no_dll_planting`** passed; parallel `--test-threads=8` re-run of `modules::storage::tests` (8/8) and `host::tests` (3/3) passed cleanly. LGTM.
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/1193/head:github-bot/gh-1193'
git switch 'github-bot/gh-1193'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1193'
git switch 'github-bot/gh-1193'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1193'
git switch 'github-bot/gh-1193'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1193'
git switch 'main'
git merge --squash 'github-bot/gh-1193'
git switch 'main'
git merge --ff-only 'github-bot/gh-1193'
git switch 'main'
git merge 'github-bot/gh-1193'
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!1193
No description provided.