test(crash): test_crash_dialog passes its quoting case's argument as hex and writes its records with LF, so it runs on Windows #1012

Open
d4nkn3ss wants to merge 1 commit from d4nkn3ss/Longshot:test/crash-dialog-utf8-arg into main
Contributor

Type: test · Risk: low · Tested on: Windows 11, RTX 3080 · Needs: none

Why

test_crash_dialog fails on Windows on main, and Windows is where the crash window runs most. It checks the window shown after a crash: its verdicts and causes, the report's redaction and the issue link. Two things stop it there, both in how the check talks to its fixture, not in the game:

  • The quoting case passes ゲーム Zélda 🎮 as a command-line argument. Windows hands a narrow argv over in the ANSI code page, so the fixture prints é as byte 0xe9, and reading its output as UTF-8 fails (UnicodeDecodeError ... 0xe9).
  • Past that, record() writes its crash records with Python's text mode, CR LF on Windows. The dialog's reader doesn't take such a file for a record, so every verdict comes back quiet. The game writes its records with WriteFile, LF, and reads them in rb.

#626 made the check run through on Linux. I searched the open PRs for its name and found none that changes it for Windows.

What changed

The quoting case sends its argument as hex, which the fixture decodes, so the bytes arrive exactly on every OS. record() writes LF. Log files stay as they were: I ran the reader on CR LF logs, with LF records, and it passed every case. What the check asserts is unchanged.

  • tests: tests/test_crash_dialog.py:
    • the fixture's quote command decodes argv[3] from hex;
    • the two quote calls send the argument's UTF-8 bytes as hex;
    • record() writes LF line ends.

Measurements

Verdict: nothing to measure: a check only. It fails on Windows main and passes here.

Flags and settings

None

Testing

Tested: python -I -B tests/run_all.py from PowerShell on Windows 11, with llvm-mingw from the Longshot Builder.

main @ 1764fed2 this PR @ cbe1f49c
test_crash_dialog FAIL: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9, then with that fixed verdict(crash, plain) = (0, 0, 0) pass
run_all.py in all 598 passed, 19 failed, 42 skipped 599 passed, 18 failed, 42 skipped

The 18 left fail on main too: test_auto_handheld, test_bug_report_defaults, test_crt_options, test_fsr_uniform_ownership, test_guest_imported, test_import_reach, test_linux_preflight, test_make_game_cache, test_missing_nup, test_pads_after_menu, test_parallel_init_order, test_pending_guest_import, test_release, test_replay_write_order, test_run_all_changed, test_tested_configurations, test_vk_occlusion_queries, test_walk_key. Some have open PRs: #1011, #1009, #1007, #1006, #1003, #993, #999, #592, #144, #954, #937 and #537.

Not tested: Linux and macOS, where argv and files were already UTF-8 and LF. The hex round trip is plain C.

Must be tested: None. The change is to a check only.

Risks

What could break: nothing in the game: only tests/ changes.

Turning it off: revert the commit.

Compatibility: Nothing changes.

Issues

See #593, #626

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened.

🤖 Generated with Claude Code

**Type:** test · **Risk:** low · **Tested on:** Windows 11, RTX 3080 · **Needs:** none ## Why `test_crash_dialog` fails on Windows on main, and Windows is where the crash window runs most. It checks the window shown after a crash: its verdicts and causes, the report's redaction and the issue link. Two things stop it there, both in how the check talks to its fixture, not in the game: - The quoting case passes `ゲーム Zélda 🎮` as a command-line argument. Windows hands a narrow `argv` over in the ANSI code page, so the fixture prints é as byte 0xe9, and reading its output as UTF-8 fails (`UnicodeDecodeError ... 0xe9`). - Past that, `record()` writes its crash records with Python's text mode, CR LF on Windows. The dialog's reader doesn't take such a file for a record, so every verdict comes back quiet. The game writes its records with `WriteFile`, LF, and reads them in `rb`. #626 made the check run through on Linux. I searched the open PRs for its name and found none that changes it for Windows. ## What changed The quoting case sends its argument as hex, which the fixture decodes, so the bytes arrive exactly on every OS. `record()` writes LF. Log files stay as they were: I ran the reader on CR LF logs, with LF records, and it passed every case. What the check asserts is unchanged. - tests: `tests/test_crash_dialog.py`: - the fixture's `quote` command decodes `argv[3]` from hex; - the two `quote` calls send the argument's UTF-8 bytes as hex; - `record()` writes LF line ends. ## Measurements **Verdict:** nothing to measure: a check only. It fails on Windows main and passes here. ### Flags and settings None ## Testing **Tested:** `python -I -B tests/run_all.py` from PowerShell on Windows 11, with llvm-mingw from the Longshot Builder. | | main @ 1764fed2 | this PR @ cbe1f49c | |---|---|---| | `test_crash_dialog` | FAIL: `UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9`, then with that fixed `verdict(crash, plain)` = (0, 0, 0) | pass | | `run_all.py` in all | 598 passed, 19 failed, 42 skipped | 599 passed, 18 failed, 42 skipped | The 18 left fail on main too: `test_auto_handheld`, `test_bug_report_defaults`, `test_crt_options`, `test_fsr_uniform_ownership`, `test_guest_imported`, `test_import_reach`, `test_linux_preflight`, `test_make_game_cache`, `test_missing_nup`, `test_pads_after_menu`, `test_parallel_init_order`, `test_pending_guest_import`, `test_release`, `test_replay_write_order`, `test_run_all_changed`, `test_tested_configurations`, `test_vk_occlusion_queries`, `test_walk_key`. Some have open PRs: #1011, #1009, #1007, #1006, #1003, #993, #999, #592, #144, #954, #937 and #537. **Not tested:** Linux and macOS, where argv and files were already UTF-8 and LF. The hex round trip is plain C. **Must be tested:** None. The change is to a check only. ## Risks **What could break:** nothing in the game: only `tests/` changes. **Turning it off:** revert the commit. **Compatibility:** Nothing changes. ## Issues See #593, #626 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(crash): test_crash_dialog passes its quoting case's argument as hex and writes its records with LF, so it runs on Windows
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
cbe1f49c84
Two things stopped test_crash_dialog on Windows. Its quoting case passed
"ゲーム Zélda 🎮" on the fixture's command line, which Windows hands a narrow
argv over in the ANSI code page: the fixture printed é as byte 0xe9 and
reading its output as UTF-8 failed. The case now sends the argument as hex,
which the fixture decodes, so the bytes are exact on every OS. Then its
record() wrote crash records in text mode, CR LF on Windows, which the
dialog's reader didn't take for records, so every verdict came back quiet.
The game writes them with WriteFile, LF. They are written with LF now. The
log files stay as they were: the reader takes CR LF logs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
d4nkn3ss changed title from WIP: test(crash): test_crash_dialog passes its quoting case's argument as hex and writes its records with LF, so it runs on Windows to test(crash): test_crash_dialog passes its quoting case's argument as hex and writes its records with LF, so it runs on Windows 2026-11-16 02:23:27 +00:00
Author
Contributor

#1056 builds on this branch: it gives the crash window the right verdict for six out-of-memory crash reports, and its new cases need this PR to run on Windows. So this one first, please.

Posted by an AI agent (Claude Code) for d4nkn3ss.

#1056 builds on this branch: it gives the crash window the right verdict for six out-of-memory crash reports, and its new cases need this PR to run on Windows. So this one first, please. *Posted by an AI agent (Claude Code) for d4nkn3ss.*
Some checks are pending
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
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 'test/crash-dialog-utf8-arg:d4nkn3ss-test/crash-dialog-utf8-arg'
git switch 'd4nkn3ss-test/crash-dialog-utf8-arg'
Sign in to join this conversation.
No reviewers
No milestone
No project
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
MagicBeanDev/Longshot!1012
No description provided.