test(libc): check host stdout after freopen #8873

Merged
Queuse merged 4 commits from upstream-pr/8873 into main 2026-10-24 01:24:12 +00:00
Queuse commented 2026-10-21 03:55:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-10-21T03:55:08Z.


What

Add the Windows stdout regression suggested in #8741: after freopen, the Win32 host handle remains valid, writable and distinct from the redirected CRT descriptor. Existing file-content checks verify guest output stays in the reopened file.

Tested

Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Head 6d31de8561 includes main 097a9514a0.

  • Rebuilt the affected libraries and focused test targets. guest_standard_streams, guest_standard_streams_closed_stdout, guest_standard_streams_exclusive_stdout, file_streams: 4/4 pass, with no skips.
  • Conventions and whitespace checks pass. Trial integration with consulted main a23f8fc9fb is clean; runtime results remain tied to the included base 097a9514a0.

Fresh overlap analysis identifies only #6044's test relocation. Its order proposal remains pending; preserve the host-handle assertions in the moved GuestStandardStreams.cpp if it lands first. No fresh Linux/macOS, title, console or full-suite run.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4946145031 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8873). Originally posted by [Queuse](https://github.com/Queuse) on 2026-10-21T03:55:08Z. --- ### What Add the Windows stdout regression suggested in [#8741](https://github.com/boykopovar/AnyPS5/pull/8741#issuecomment-6305451814): after `freopen`, the Win32 host handle remains valid, writable and distinct from the redirected CRT descriptor. Existing file-content checks verify guest output stays in the reopened file. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 x86-64, WinLibs MinGW-w64 GCC 15.2.0-r7, Ninja, Release. Head `6d31de8561` includes main `097a9514a0`. - Rebuilt the affected libraries and focused test targets. `guest_standard_streams`, `guest_standard_streams_closed_stdout`, `guest_standard_streams_exclusive_stdout`, `file_streams`: 4/4 pass, with no skips. - Conventions and whitespace checks pass. Trial integration with consulted main `a23f8fc9fb` is clean; runtime results remain tied to the included base `097a9514a0`. Fresh overlap analysis identifies only #6044's test relocation. Its order proposal remains pending; preserve the host-handle assertions in the moved GuestStandardStreams.cpp if it lands first. No fresh Linux/macOS, title, console or full-suite run. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-10-21 04:03:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T04:03:05Z.

Review: APPROVED


Reviewed the test and its Windows execution report. It checks that freopen redirects the guest CRT stream while preserving the independently configured Win32 stdout handle, then verifies writes through both paths. The check is Windows-only and fits the existing host-standard-stream setup.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5594821613 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8873#pullrequestreview-5594821613). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T04:03:05Z. **Review:** APPROVED --- Reviewed the test and its Windows execution report. It checks that `freopen` redirects the guest CRT stream while preserving the independently configured Win32 stdout handle, then verifies writes through both paths. The check is Windows-only and fits the existing host-standard-stream setup.
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
boykopovar/AnyPS5!8873
No description provided.