test(libSceAudioOut): cover sceAudioOut2ContextSetAttributes argument checks #12906

Merged
legendary-cookie merged 1 commit from upstream-pr/12906 into main 2026-11-05 08:51:04 +00:00
legendary-cookie commented 2026-10-29 13:57:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by legendary-cookie on 2026-10-29T13:57:36Z.


What

Adds ContextSetAttributesChecksArguments to AudioOut2DeviceState.cpp, on the context that test already creates: sceAudioOut2ContextSetAttributes returns SCE_AUDIO_OUT2_ERROR_INVALID_HANDLE for handle 0, SCE_AUDIO_OUT2_ERROR_INVALID_ARGUMENT for a null list with a count of 1, and 0 for a null list with a count of 0 and for a one-element list.

Source: docs/dev/debt/libSceAudioOut.md already records these results and that the attributes themselves are ignored; the test asserts only the return values.

Tested

Windows 11, WinLibs GCC 15.2.0 UCRT r7 (the CI toolchain), Release, BUILD_TESTING=ON, on main 95137178d0: ctest -R ^audio_out2_device_state$ passes, and the 12 filesystem, Hmd2 and AudioOut2 tests pass with this branch applied together with the other two opened alongside it. Mutation-checked: returning 0 for an invalid handle or for a null list with a count, or rejecting a null list with a count of 0, each makes the test fail. tools/check_conventions.py --base origin/main passes; tools/pr_overlap.py reports no overlap. Not run on Linux or macOS.

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 (Claude Code, OpenAI Codex)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5069348116 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12906). Originally posted by [legendary-cookie](https://github.com/legendary-cookie) on 2026-10-29T13:57:36Z. --- ### What Adds `ContextSetAttributesChecksArguments` to `AudioOut2DeviceState.cpp`, on the context that test already creates: `sceAudioOut2ContextSetAttributes` returns `SCE_AUDIO_OUT2_ERROR_INVALID_HANDLE` for handle 0, `SCE_AUDIO_OUT2_ERROR_INVALID_ARGUMENT` for a null list with a count of 1, and 0 for a null list with a count of 0 and for a one-element list. Source: `docs/dev/debt/libSceAudioOut.md` already records these results and that the attributes themselves are ignored; the test asserts only the return values. ### Tested Windows 11, WinLibs GCC 15.2.0 UCRT r7 (the CI toolchain), Release, `BUILD_TESTING=ON`, on `main` 95137178d0: `ctest -R ^audio_out2_device_state$` passes, and the 12 filesystem, Hmd2 and AudioOut2 tests pass with this branch applied together with the other two opened alongside it. Mutation-checked: returning 0 for an invalid handle or for a null list with a count, or rejecting a null list with a count of 0, each makes the test fail. `tools/check_conventions.py --base origin/main` passes; `tools/pr_overlap.py` reports no overlap. Not run on Linux or macOS. ### 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 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code, OpenAI Codex) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-29 14:05:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T14:05:31Z.

Review: APPROVED


Reviewed — looks good

On head fd89a651a53bf5fe8c676f2b7674ff246b130459, the added argument checks match the existing implementation and debt record; the current-main merge preview is clean and conventions pass. The author reports the focused Windows test passed; I did not run the C++ test locally, and hosted policy checks were still pending.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5699025858 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12906#pullrequestreview-5699025858). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T14:05:31Z. **Review:** APPROVED --- # Reviewed — looks good On head `fd89a651a53bf5fe8c676f2b7674ff246b130459`, the added argument checks match the existing implementation and debt record; the current-main merge preview is clean and conventions pass. The author reports the focused Windows test passed; I did not run the C++ test locally, and hosted policy checks were still pending.
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!12906
No description provided.