tests: add edge-case tests for inline_scan add-advance and --sites #536

Closed
kotekompotek wants to merge 1 commit from upstream-pr/536 into main
kotekompotek commented 2026-11-24 07:12:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-24T07:12:18Z.


Claimed in the coordination issue as: coordination issue #14

What and why

  • Rebased onto current main and squashed into one clean commit.
  • Added edge-case tests for tools/inline_scan.py in tests/test_inline_scan_extra.py.

Tested

  • python -m pytest tests/test_inline_scan_extra.py passed after rebasing onto current main.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5467775007 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/536). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-24T07:12:18Z. --- Claimed in the coordination issue as: coordination issue #14 ### What and why - Rebased onto current `main` and squashed into one clean commit. - Added edge-case tests for `tools/inline_scan.py` in `tests/test_inline_scan_extra.py`. ### Tested - `python -m pytest tests/test_inline_scan_extra.py` passed after rebasing onto current `main`. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
kawaii-shakal commented 2026-11-24 07:55:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-24T07:55:20Z.


Reviewed head 13511818d8f9ae404f14ae6d5d23cadb239ee47b (AI-assisted review). Environment: Linux (WSL2), Python venv with pytest, no GPU. No game files used; the listings are the PR's hand-written ones.

What ran: python -m pytest tests/test_inline_scan_extra.py tests/test_inline_scan.py: 16 passed.

Mutations to tools/inline_scan.py:

  • disabled the reversed cmp qword ptr [list+X],reg form of CMP: caught by test_add_cursor_advance_and_reversed_cmp_is_checked. The existing suite misses it, so this test adds real coverage.
  • add not added to the size: caught
  • fallback slot computed as // 4: caught
  • --sites prints the load address as the store address: caught by the 0x201b assert
  • the --sites row label UNCHECKED changed to unchecked: missed

Finding (needs change): assert "UNCHECKED" in proc.stdout in test_cli_sites_flag_prints_site_details passes whatever --sites prints. The summary line always contains UNCHECKED <n>, even with no --sites. To check the per-site row, assert on the row itself, for example "store +0x201b [rbx] UNCHECKED" in proc.stdout, or check that a line starting with load contains UNCHECKED.

Minor: the file has no __main__ block, so it runs only under pytest. AGENTS.md allows that.

Not tested: the dumpbin path for .exe/.dll input (Windows only).


Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7125521002 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/536#issuecomment-7125521002). Originally posted by [kawaii-shakal](https://github.com/kawaii-shakal) on 2026-11-24T07:55:20Z. --- Reviewed head 13511818d8f9ae404f14ae6d5d23cadb239ee47b (AI-assisted review). Environment: Linux (WSL2), Python venv with pytest, no GPU. No game files used; the listings are the PR's hand-written ones. What ran: `python -m pytest tests/test_inline_scan_extra.py tests/test_inline_scan.py`: 16 passed. Mutations to `tools/inline_scan.py`: - disabled the reversed `cmp qword ptr [list+X],reg` form of `CMP`: caught by `test_add_cursor_advance_and_reversed_cmp_is_checked`. The existing suite misses it, so this test adds real coverage. - `add` not added to the size: caught - fallback slot computed as `// 4`: caught - `--sites` prints the load address as the store address: caught by the `0x201b` assert - the `--sites` row label `UNCHECKED` changed to `unchecked`: **missed** Finding (needs change): `assert "UNCHECKED" in proc.stdout` in `test_cli_sites_flag_prints_site_details` passes whatever `--sites` prints. The summary line always contains `UNCHECKED <n>`, even with no `--sites`. To check the per-site row, assert on the row itself, for example `"store +0x201b [rbx] UNCHECKED" in proc.stdout`, or check that a line starting with ` load` contains `UNCHECKED`. Minor: the file has no `__main__` block, so it runs only under pytest. AGENTS.md allows that. Not tested: the dumpbin path for `.exe`/`.dll` input (Windows only). --- _Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account._
kawaii-shakal commented 2026-11-24 14:47:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-24T14:47:52Z.


Re-checked head 45674fb413646157e478a1b7a9db6f2ab1e9e0b0. Environment: Windows 11, native Python 3.13, no pytest, no GPU. I used no game files, only the PR's hand-written listings.

What ran:

  • python -I tests/test_inline_scan_extra.py: passes (exit 0).
  • python -I tests/test_inline_scan.py: OK.
  • python -I scripts/check_no_game_data.py tests/test_inline_scan_extra.py: exit 0.
  • Mutations to tools/inline_scan.py, reverted after each run:
    • per-site --sites row label UNCHECKED changed to unchecked: now caught (exit 1).
    • --sites row prints the load address as the store address: caught (exit 1).
  • Merges cleanly into current main (f3e26be7c).

Earlier remarks:

  • "UNCHECKED" in proc.stdout matched the summary line: resolved. The test now requires one line with store, 0x201b and UNCHECKED together. Only the per-site row has all three, and the label mutation that was missed before now fails.
  • No __main__ block (minor): resolved. The file runs with python -I.

No further changes requested from me.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7134962505 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/536#issuecomment-7134962505). Originally posted by [kawaii-shakal](https://github.com/kawaii-shakal) on 2026-11-24T14:47:52Z. --- Re-checked head 45674fb413646157e478a1b7a9db6f2ab1e9e0b0. Environment: Windows 11, native Python 3.13, no pytest, no GPU. I used no game files, only the PR's hand-written listings. What ran: - `python -I tests/test_inline_scan_extra.py`: passes (exit 0). - `python -I tests/test_inline_scan.py`: OK. - `python -I scripts/check_no_game_data.py tests/test_inline_scan_extra.py`: exit 0. - Mutations to `tools/inline_scan.py`, reverted after each run: - per-site `--sites` row label `UNCHECKED` changed to `unchecked`: now caught (exit 1). - `--sites` row prints the load address as the store address: caught (exit 1). - Merges cleanly into current main (f3e26be7c). Earlier remarks: - `"UNCHECKED" in proc.stdout` matched the summary line: resolved. The test now requires one line with `store`, `0x201b` and `UNCHECKED` together. Only the per-site row has all three, and the label mutation that was missed before now fails. - No `__main__` block (minor): resolved. The file runs with `python -I`. No further changes requested from me. AI-assisted.
kotekompotek commented 2026-11-25 08:58:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-25T08:58:28Z.


Rebased on current ubi/main (3f81d46ac), no conflicts. The added tests pass locally on this base (python -I).

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7157708693 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/536#issuecomment-7157708693). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T08:58:28Z. --- Rebased on current ubi/main (3f81d46ac), no conflicts. The added tests pass locally on this base (python -I). AI-assisted: yes
DadaCap commented 2026-11-28 10:32:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T10:32:49Z.


Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures.

Reason: edge-case tests only.

If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237966164 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/536#issuecomment-7237966164). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T10:32:49Z. --- Thanks for the contribution! This PR was reviewed by the maintainers and is being closed as part of a large batch of closures. Reason: edge-case tests only. If this looks like a mistake, mention @DadaCap here at any time and it will be looked at again. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

Pull request closed

Sign in to join this conversation.
No reviewers
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
ProjectLeonida/mandy!536
No description provided.