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

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

@⁠kotekompotek on GitHub · 2026-11-24 07:12 UTC · original
kotekompotek:work/test-inline-scan-extra → main · +70 −0 · 1 files · 1 commits · open

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.
**@⁠kotekompotek** on GitHub · 2026-11-24 07:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/536) `kotekompotek:work/test-inline-scan-extra` → `main` · +70 −0 · 1 files · 1 commits · open 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:07:13 +00:00
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-24 07:55 UTC · original

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** on GitHub · 2026-11-24 07:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/536#issuecomment-7125521002) 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._
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-24 14:47 UTC · original

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.

**@⁠kawaii-shakal** on GitHub · 2026-11-24 14:47 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/536#issuecomment-7134962505) 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.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 08:58 UTC · original

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

AI-assisted: yes

**@⁠kotekompotek** on GitHub · 2026-11-25 08:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/536#issuecomment-7157708693) Rebased on current ubi/main (3f81d46ac), no conflicts. The added tests pass locally on this base (python -I). AI-assisted: yes
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/536/head:github-bot/gh-536'
git switch 'github-bot/gh-536'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-536'
git switch 'github-bot/gh-536'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-536'
git switch 'github-bot/gh-536'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-536'
git switch 'main'
git merge --squash 'github-bot/gh-536'
git switch 'main'
git merge --ff-only 'github-bot/gh-536'
git switch 'main'
git merge 'github-bot/gh-536'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.