test(libSceCdlgPlayerReview): cover base reserved validation and finished dialog reopen #12516

Closed
PrivacyOnion wants to merge 2 commits from upstream-pr/12516 into main
PrivacyOnion commented 2026-10-28 16:54:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-10-28T16:54:53Z.


What

In core/libs/tests/GuestPlayerReviewDialog.cpp:

  • Verify scePlayerReviewDialogOpen rejects non-zero param.base.reserved bytes with 0x80B8000A (COMMON_DIALOG_ERROR_INVALID_ARGUMENT).
  • Verify scePlayerReviewDialogOpen in the FINISHED state returns 0x80B8000D (COMMON_DIALOG_ERROR_ARG_NULL) for nullptr and preserves COMMON_DIALOG_STATUS_FINISHED.
  • Verify scePlayerReviewDialogOpen in the FINISHED state returns 0x80B8000A (COMMON_DIALOG_ERROR_INVALID_ARGUMENT) for invalid parameters (param.size = 0) and preserves COMMON_DIALOG_STATUS_FINISHED.
  • Verify scePlayerReviewDialogOpen in the FINISHED state successfully reopens with a valid parameter, returning 0 and maintaining COMMON_DIALOG_STATUS_FINISHED.

In docs/dev/debt/libSceCdlgPlayerReview.md:

  • Document that the dialog lifecycle after FINISHED is not measured on a console.

Tested

ctest --test-dir build -R '^guest_player_review_dialog$' --output-on-failure (on commit bdc2c502bd in worktree):

$ ctest --test-dir build -R '^guest_player_review_dialog$' --output-on-failure
Test project C:/Users/playl/Desktop/dashy/data/worktrees/1028-184137-4ac4/build
    Start 1828: guest_player_review_dialog
1/1 Test #1828: guest_player_review_dialog .......   Passed    0.60 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.72 sec

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:5054365897 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12516). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-10-28T16:54:53Z. --- ### What In `core/libs/tests/GuestPlayerReviewDialog.cpp`: - Verify `scePlayerReviewDialogOpen` rejects non-zero `param.base.reserved` bytes with `0x80B8000A` (`COMMON_DIALOG_ERROR_INVALID_ARGUMENT`). - Verify `scePlayerReviewDialogOpen` in the `FINISHED` state returns `0x80B8000D` (`COMMON_DIALOG_ERROR_ARG_NULL`) for `nullptr` and preserves `COMMON_DIALOG_STATUS_FINISHED`. - Verify `scePlayerReviewDialogOpen` in the `FINISHED` state returns `0x80B8000A` (`COMMON_DIALOG_ERROR_INVALID_ARGUMENT`) for invalid parameters (`param.size = 0`) and preserves `COMMON_DIALOG_STATUS_FINISHED`. - Verify `scePlayerReviewDialogOpen` in the `FINISHED` state successfully reopens with a valid parameter, returning `0` and maintaining `COMMON_DIALOG_STATUS_FINISHED`. In `docs/dev/debt/libSceCdlgPlayerReview.md`: - Document that the dialog lifecycle after `FINISHED` is not measured on a console. ### 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. --> `ctest --test-dir build -R '^guest_player_review_dialog$' --output-on-failure` (on commit `bdc2c502bd` in worktree): ``` $ ctest --test-dir build -R '^guest_player_review_dialog$' --output-on-failure Test project C:/Users/playl/Desktop/dashy/data/worktrees/1028-184137-4ac4/build Start 1828: guest_player_review_dialog 1/1 Test #1828: guest_player_review_dialog ....... Passed 0.60 sec 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 0.72 sec ``` ### 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
rooklz commented 2026-10-28 19:05:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by rooklz on 2026-10-28T19:05:00Z.

Review: APPROVED


Reviewed exact head bdc2c502bd (merges cleanly onto main 319621ba2e). This is the first run on macOS (arm64, Apple clang, ASan+UBSan).

What I ran

  • I built a standalone Export.cpp + libSceUserService/Export.cpp + test. A two-symbol link shim aborts for NotImplemented_nid_no_patch / sceSystemServiceParamGetInt, and the test never calls either. Head test passes, 50/50 reruns. Main's test also passes against the unchanged library, which is expected for a test-only change.
  • I ran 10 implementation mutants against the head test and against main's test:
mutant head test main test
shared base validator ignores base.reserved killed survives
validator checks only reserved[0..34] killed survives
validator checks only reserved[1..35] killed survives
FINISHED → BUSY on Open killed survives
FINISHED Open returns 0 without validating killed survives
FINISHED Open(nullptr) returns 0 killed survives
failed Open in FINISHED resets status to 1 killed survives
Open(nullptr) in FINISHED resets status to 1 killed survives
successful reopen sets status to 1 killed survives
FINISHED Open skips the login-user check survives survives

So 9/10 are caught only by this PR, and both ends of reserved are pinned.

Optional (non-blocking)

The surviving mutant can be killed by sending one user who is not logged in through the reopen path. The head implementation passes this, and the mutant aborts:

@@ -94,6 +94,10 @@
     Require(scePlayerReviewDialogOpen(&param) == static_cast<int>(0x80B8000Au));
     Require(scePlayerReviewDialogGetStatus() == COMMON_DIALOG_STATUS_FINISHED);
     param.size = sizeof(param);
+    param.userId = USER_SERVICE_INITIAL_USER_ID + 1;
+    Require(scePlayerReviewDialogOpen(&param) == static_cast<int>(0x80B8000Au));
+    Require(scePlayerReviewDialogGetStatus() == COMMON_DIALOG_STATUS_FINISHED);
+    param.userId = USER_SERVICE_INITIAL_USER_ID;
     Require(scePlayerReviewDialogOpen(&param) == 0);
     Require(scePlayerReviewDialogGetStatus() == COMMON_DIALOG_STATUS_FINISHED);
     Require(scePlayerReviewDialogUpdateStatus() == COMMON_DIALOG_STATUS_FINISHED);

git merge-tree against main and check_conventions --base upstream/main are both clean. Nit: the new debt line repeats itself ("Dialog lifecycle ... - dialog lifecycle after FINISHED"). The other entries read "name (lib) ".

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5688194120 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12516#pullrequestreview-5688194120). Originally posted by [rooklz](https://github.com/rooklz) on 2026-10-28T19:05:00Z. **Review:** APPROVED --- Reviewed exact head `bdc2c502bd` (merges cleanly onto main `319621ba2e`). This is the first run on macOS (arm64, Apple clang, ASan+UBSan). ### What I ran - I built a standalone `Export.cpp` + `libSceUserService/Export.cpp` + test. A two-symbol link shim aborts for `NotImplemented_nid_no_patch` / `sceSystemServiceParamGetInt`, and the test never calls either. Head test passes, 50/50 reruns. Main's test also passes against the unchanged library, which is expected for a test-only change. - I ran 10 implementation mutants against the head test and against main's test: | mutant | head test | main test | |---|---|---| | shared base validator ignores `base.reserved` | killed | survives | | validator checks only `reserved[0..34]` | killed | survives | | validator checks only `reserved[1..35]` | killed | survives | | `FINISHED` → `BUSY` on Open | killed | survives | | `FINISHED` Open returns 0 without validating | killed | survives | | `FINISHED` Open(nullptr) returns 0 | killed | survives | | failed Open in `FINISHED` resets status to 1 | killed | survives | | Open(nullptr) in `FINISHED` resets status to 1 | killed | survives | | successful reopen sets status to 1 | killed | survives | | `FINISHED` Open skips the login-user check | **survives** | survives | So 9/10 are caught only by this PR, and both ends of `reserved` are pinned. ### Optional (non-blocking) The surviving mutant can be killed by sending one user who is not logged in through the reopen path. The head implementation passes this, and the mutant aborts: ```diff @@ -94,6 +94,10 @@ Require(scePlayerReviewDialogOpen(&param) == static_cast<int>(0x80B8000Au)); Require(scePlayerReviewDialogGetStatus() == COMMON_DIALOG_STATUS_FINISHED); param.size = sizeof(param); + param.userId = USER_SERVICE_INITIAL_USER_ID + 1; + Require(scePlayerReviewDialogOpen(&param) == static_cast<int>(0x80B8000Au)); + Require(scePlayerReviewDialogGetStatus() == COMMON_DIALOG_STATUS_FINISHED); + param.userId = USER_SERVICE_INITIAL_USER_ID; Require(scePlayerReviewDialogOpen(&param) == 0); Require(scePlayerReviewDialogGetStatus() == COMMON_DIALOG_STATUS_FINISHED); Require(scePlayerReviewDialogUpdateStatus() == COMMON_DIALOG_STATUS_FINISHED); ``` `git merge-tree` against main and `check_conventions --base upstream/main` are both clean. Nit: the new debt line repeats itself ("Dialog lifecycle ... - dialog lifecycle after `FINISHED`"). The other entries read "[name](link) (lib) <sentence>".
MarcZX10 commented 2026-10-29 06:14:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T06:14:48Z.

Review: APPROVED


Re-checked — approved

The exact-head guest_player_review_dialog CTest result is now recorded twice by the author on bdc2c502bd, and an independent reviewer reports an exact-head macOS ASan/UBSan run as well. I checked that the updated debt entry explicitly says post-FINISHED lifecycle behavior has not been measured on a console, matching the scope of these test additions.

The current branch is mergeable; hosted Windows, conventions, eligibility, and labels pass. Other product jobs were skipped by path policy. I did not run the test locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693606271 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12516#pullrequestreview-5693606271). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T06:14:48Z. **Review:** APPROVED --- ## Re-checked — approved The exact-head `guest_player_review_dialog` CTest result is now recorded twice by the author on `bdc2c502bd`, and an independent reviewer reports an exact-head macOS ASan/UBSan run as well. I checked that the updated debt entry explicitly says post-`FINISHED` lifecycle behavior has not been measured on a console, matching the scope of these test additions. The current branch is mergeable; hosted Windows, conventions, eligibility, and labels pass. Other product jobs were skipped by path policy. I did not run the test locally.

Pull request closed

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!12516
No description provided.