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

Open
opened 2026-11-24 14:24:23 +00:00 by geiyiliyabumo · 3 comments
geiyiliyabumo commented 2026-11-24 14:24:23 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T14:24:23Z.


Summary

Adds 10 deterministic synthetic unit tests for crates/victory-hle/src/modules/storage.rs (1 -> 7 tests, plus Default derive on SpaceInfo) and crates/victory-hle/src/host.rs (0 -> 3 tests).

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/hle-storage-and-host
  • Commit: geiyiliyabumo/VIctory@62abb60 (based on main ffe310e)

Tests Added (Synthetic Only)

  • crates/victory-hle/src/modules/storage.rs (7 tests total): drive-root serving, IID/IID_2026 query, path calls before/after storage setup, drive root + NUL buffer handling, recursive used_bytes, quota/free space reporting, and async space-prompt bounds.
  • crates/victory-hle/src/host.rs (3 tests total): case-insensitive DLL name/prefix matching, default allow-list policy, and allowed DLL host function resolution.

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check: PASS
  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- storage:: (7/7 modules::storage::tests PASS) & -- host:: (3/3 host::tests PASS)

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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6583972125 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/942). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T14:24:23Z. --- ### Summary Adds 10 deterministic synthetic unit tests for `crates/victory-hle/src/modules/storage.rs` (1 -> 7 tests, plus `Default` derive on `SpaceInfo`) and `crates/victory-hle/src/host.rs` (0 -> 3 tests). 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/hle-storage-and-host` - **Commit**: `geiyiliyabumo/VIctory@62abb60` (based on `main` `ffe310e`) ### Tests Added (Synthetic Only) - `crates/victory-hle/src/modules/storage.rs` (7 tests total): drive-root serving, `IID`/`IID_2026` query, path calls before/after storage setup, drive root + NUL buffer handling, recursive `used_bytes`, quota/free space reporting, and async space-prompt bounds. - `crates/victory-hle/src/host.rs` (3 tests total): case-insensitive DLL name/prefix matching, default allow-list policy, and allowed DLL host function resolution. ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check`: **PASS** - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- storage::` (**7/7** `modules::storage::tests` PASS) & `-- host::` (**3/3** `host::tests` PASS) *AI-assisted; synthetic tests only, no game files.*
Marvisak commented 2026-11-25 07:03:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:51:39Z.


Automated triage for the maintainers.

This requests test coverage and comes with a branch. On current main, crates/victory-hle/src/modules/storage.rs and crates/victory-hle/src/host.rs still have one unit test each, so these tests would add coverage.

Correction to the earlier version of this comment: open PR #1193 carries this branch. The comments above report that it passes as-is (105 victory-hle tests) but sits on the old ffe310e base and is far behind main. It needs a rebase before review. The maintainers decide from there.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155234316 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/942#issuecomment-7155234316). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:51:39Z. --- <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-25T09:10:09Z at=2026-11-25T09:50:38Z --> Automated triage for the maintainers. This requests test coverage and comes with a branch. On current `main`, `crates/victory-hle/src/modules/storage.rs` and `crates/victory-hle/src/host.rs` still have one unit test each, so these tests would add coverage. Correction to the earlier version of this comment: open PR #1193 carries this branch. The comments above report that it passes as-is (105 `victory-hle` tests) but sits on the old `ffe310e` base and is far behind `main`. It needs a rebase before review. The maintainers decide from there. --- _Generated by [Claude Code](https://claude.ai/code)_
StExpeditus commented 2026-11-25 10:07:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:09:49Z.


Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, Rust 1.98.1 MSVC), commit 62abb60: cargo test -p victory-hle --locked --no-fail-fast -> 105 passed, 0 failed, 0 ignored. Synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157958750 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/942#issuecomment-7157958750). Originally posted by [StExpeditus](https://github.com/StExpeditus) on 2026-11-25T09:09:49Z. --- Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, Rust 1.98.1 MSVC), commit `62abb60`: `cargo test -p victory-hle --locked --no-fail-fast` -> **105 passed, 0 failed, 0 ignored**. Synthetic tests only, no game files.
StExpeditus commented 2026-11-25 10:07:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:10:09Z.


Addendum: this branch's base is well behind current main - the victory-hle delta against main is 28 files, 563 insertions, 4,300 deletions (e.g. tests/fidelityfx.rs moved since). The 105 passed above are the branch as-is on its old base; it needs a rebase before a clean cherry-pick. The other three validated issues from this author (#1029, #1028, #945) apply with only small delta.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157966585 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/942#issuecomment-7157966585). Originally posted by [StExpeditus](https://github.com/StExpeditus) on 2026-11-25T09:10:09Z. --- Addendum: this branch's base is well behind current main - the `victory-hle` delta against main is 28 files, 563 insertions, 4,300 deletions (e.g. `tests/fidelityfx.rs` moved since). The 105 passed above are the branch as-is on its old base; it needs a rebase before a clean cherry-pick. The other three validated issues from this author (#1029, #1028, #945) apply with only small delta.
Sign in to join this conversation.
No labels
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.

Reference
Marvisak/VIctory#942
No description provided.