tests: make the SGD5 negative record offset control portable #2624

Merged
R0Y00 merged 1 commit from upstream-pr/2632 into main 2026-11-25 23:48:23 +00:00
R0Y00 commented 2026-11-25 23:44:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T23:44:19Z.


Follow-up to #2608. On Windows Python 3.12.6 the separate -0x10 token after --record is treated as an option by argparse. The pair then fails for missing arguments before the offset parser can give the diagnostic the fixture is intended to check. Use decimal -16 in that CLI control. The direct parser test still checks negative hexadecimal offsets, and the CLI --arrays=-0x1 case remains.

On Windows Python 3.12.6, the exact c2bdc2fe CLI suite failed twice at the negative record-end case (with an existing and a missing archive). At 197193e8, python -B tests/sgd5_effects_cli_check.py passed 7/7 and python -B tests/sgd5_effects_check.py passed 4/4. No production parser changes.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6616101882 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2632). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T23:44:19Z. --- Follow-up to #2608. On Windows Python 3.12.6 the separate `-0x10` token after `--record` is treated as an option by argparse. The pair then fails for missing arguments before the offset parser can give the diagnostic the fixture is intended to check. Use decimal `-16` in that CLI control. The direct parser test still checks negative hexadecimal offsets, and the CLI `--arrays=-0x1` case remains. On Windows Python 3.12.6, the exact `c2bdc2fe` CLI suite failed twice at the negative record-end case (with an existing and a missing archive). At `197193e8`, `python -B tests/sgd5_effects_cli_check.py` passed 7/7 and `python -B tests/sgd5_effects_check.py` passed 4/4. No production parser changes.
tedin7 commented 2026-11-25 23:47:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:47:35Z.

Review: COMMENTED


Review of head 197193e8 (comment only).

Result: the change looks sound. It touches one test file, one case, and no production code.

  • Using -16 instead of a separate -0x10 token avoids the argparse option-token problem. The case still reaches the offset parser.
  • The negative hex path is still checked elsewhere, by the direct parser test and by the --arrays=-0x1 CLI case.
  • Mutation check: I changed the offset() negative check in tools/sgd5_effects.py to accept negatives. sgd5_effects_cli_check.py then failed (failures=13), so the fixture still guards the behavior. I reverted the change.

Commands run locally (worktree at the exact head):

  • python3 -B tests/sgd5_effects_cli_check.py: 7/7 OK
  • python3 -B tests/sgd5_effects_check.py: 4/4 OK
  • git diff --check origin/main...HEAD: clean
  • python3 tests/docs_links_check.py: OK
  • python3 tests/bidi_controls_check.py: OK

Not done: no Win2025 run. The PR text reports its own Windows Python 3.12.6 run on this head. CI was still pending when I looked.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6066599528 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2632#pullrequestreview-6066599528). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T23:47:35Z. **Review:** COMMENTED --- Review of head `197193e8` (comment only). Result: the change looks sound. It touches one test file, one case, and no production code. - Using `-16` instead of a separate `-0x10` token avoids the argparse option-token problem. The case still reaches the offset parser. - The negative hex path is still checked elsewhere, by the direct parser test and by the `--arrays=-0x1` CLI case. - Mutation check: I changed the `offset()` negative check in `tools/sgd5_effects.py` to accept negatives. `sgd5_effects_cli_check.py` then failed (failures=13), so the fixture still guards the behavior. I reverted the change. Commands run locally (worktree at the exact head): - `python3 -B tests/sgd5_effects_cli_check.py`: 7/7 OK - `python3 -B tests/sgd5_effects_check.py`: 4/4 OK - `git diff --check origin/main...HEAD`: clean - `python3 tests/docs_links_check.py`: OK - `python3 tests/bidi_controls_check.py`: OK Not done: no Win2025 run. The PR text reports its own Windows Python 3.12.6 run on this head. CI was still pending when I looked. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 00:01:06 +00:00
tedin7 commented 2026-11-26 00:01:13 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:48:15Z.


Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 197193e8dbf364246b7f96bf2aaab0557112f58f:

  • Windows Python checks: tests/sgd5_effects_cli_check.py ok (4.6s), tests/sgd5_effects_check.py ok (0.5s)

Python-only change; dev and release builds not needed (no CTest target).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7178073823 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2632#issuecomment-7178073823). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T23:48:15Z. --- Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `197193e8dbf364246b7f96bf2aaab0557112f58f`: - **Windows Python checks**: `tests/sgd5_effects_cli_check.py` ok (`4.6s`), `tests/sgd5_effects_check.py` ok (`0.5s`) Python-only change; dev and release builds not needed (no CTest target). AI-assisted; commands listed were executed locally.
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
R0Y00/Xbox2Windows!2624
No description provided.