test(libSceNpEntitlementAccess): cover request bounds and parameter checks in GuestEntitlements #11909

Merged
PrivacyOnion merged 2 commits from upstream-pr/11909 into main 2026-10-29 13:39:39 +00:00
PrivacyOnion commented 2026-10-27 12:24:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-10-27T12:24:24Z.


What

Cover invalid request parameters, poll info limits, and handle validations in GuestEntitlements.

Tested

  • Built and ran ctest --test-dir build -R '^guest_entitlements' -V on Windows 11 (MinGW-w64 GCC 16.1.0 UCRT), all 2 test suites passed (0.06s).
  • Ran python tools/check_conventions.py --base upstream/main, passed with 0 errors.

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:5033841585 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11909). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-10-27T12:24:24Z. --- ### What Cover invalid request parameters, poll info limits, and handle validations in `GuestEntitlements`. ### 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. --> - Built and ran `ctest --test-dir build -R '^guest_entitlements' -V` on Windows 11 (MinGW-w64 GCC 16.1.0 UCRT), all 2 test suites passed (0.06s). - Ran `python tools/check_conventions.py --base upstream/main`, passed with 0 errors. ### 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
MarcZX10 commented 2026-10-27 12:38:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T12:38:20Z.

Review: DISMISSED


The new sceNpEntitlementAccessInitialize(nullptr, nullptr) == 0 assertion at GuestEntitlements.cpp:71 codifies the current implementation’s unconditional no-op success, but this PR reports only Windows tests and the library debt says native initialization and validation are unresolved. Since this test adds a parameter-behavior claim without console evidence, please remove that assertion or attach a measurement establishing that null init/boot parameters are accepted. I found no other blocking discrepancy in the added calls; the GetEntitlementKey error expectations match the documented emulator reference, though the debt correctly says console precedence remains unverified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5667144897 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11909#pullrequestreview-5667144897). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T12:38:20Z. **Review:** DISMISSED --- The new `sceNpEntitlementAccessInitialize(nullptr, nullptr) == 0` assertion at `GuestEntitlements.cpp:71` codifies the current implementation’s unconditional no-op success, but this PR reports only Windows tests and the library debt says native initialization and validation are unresolved. Since this test adds a parameter-behavior claim without console evidence, please remove that assertion or attach a measurement establishing that null init/boot parameters are accepted. I found no other blocking discrepancy in the added calls; the `GetEntitlementKey` error expectations match the documented emulator reference, though the debt correctly says console precedence remains unverified.
adriadam10 commented 2026-10-28 09:36:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T09:36:08Z.

Review: CHANGES_REQUESTED


Thanks for removing the sceNpEntitlementAccessInitialize assertion. The same concern applies to most of the others added here:

  • GuestEntitlements.cpp:76-85: these eight assertions pin 0x80550006 from stubs that ignore their arguments (GenerateTransactionId, PollConsumeEntitlement, RequestConsume*, Poll*EntitlementInfo, Request*EntitlementInfo). Several pass nullptr for the label, transaction ID or info pointer, so the test asserts that no parameter validation happens. docs/dev/debt/libSceNpEntitlementAccess.md ("Entitlement requests and polls") says these signed-out responses do not reproduce native initialization or validation, and nothing in the PR shows measured console behaviour for them.
  • Please drop them, or keep only calls with valid arguments that exercise the signed-out path, without claiming anything about null handling.
  • GuestEntitlements.cpp:72-74 (GetEntitlementKey) is fine: the errors follow KytyPS5 and are recorded in the debt file.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5680532618 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11909#pullrequestreview-5680532618). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-28T09:36:08Z. **Review:** CHANGES_REQUESTED --- Thanks for removing the `sceNpEntitlementAccessInitialize` assertion. The same concern applies to most of the others added here: - `GuestEntitlements.cpp:76-85`: these eight assertions pin `0x80550006` from stubs that ignore their arguments (`GenerateTransactionId`, `PollConsumeEntitlement`, `RequestConsume*`, `Poll*EntitlementInfo`, `Request*EntitlementInfo`). Several pass `nullptr` for the label, transaction ID or info pointer, so the test asserts that no parameter validation happens. `docs/dev/debt/libSceNpEntitlementAccess.md` ("Entitlement requests and polls") says these signed-out responses do not reproduce native initialization or validation, and nothing in the PR shows measured console behaviour for them. - Please drop them, or keep only calls with valid arguments that exercise the signed-out path, without claiming anything about null handling. - `GuestEntitlements.cpp:72-74` (`GetEntitlementKey`) is fine: the errors follow KytyPS5 and are recorded in the debt file.
THEMANnt commented 2026-10-28 16:57:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T16:57:20Z.

Review: APPROVED


Reviewed 6e775896ba1afe9fa33251b17dd13f8753a001c1 — approve. The entitlement-key assertions distinguish null argument rejection from the unavailable-key result for a valid synthetic entitlement label. They extend the local entitlement fixture without an online entitlement service.

Windows/GCC 15.3 Release native validation from pinned sources: head: 2 passed, 0 skipped; guest_entitlements, guest_entitlements_missing; author base was source-compared: production sources are unchanged; its runtime was not built or executed for this review. This changes test coverage, not production behavior, so an old-production failure is not required. The build reuses matching dependency source pins and the existing FFmpeg package; no full product or game execution is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5686522929 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11909#pullrequestreview-5686522929). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-28T16:57:20Z. **Review:** APPROVED --- Reviewed `6e775896ba1afe9fa33251b17dd13f8753a001c1` — approve. The entitlement-key assertions distinguish null argument rejection from the unavailable-key result for a valid synthetic entitlement label. They extend the local entitlement fixture without an online entitlement service. Windows/GCC 15.3 Release native validation from pinned sources: head: 2 passed, 0 skipped; `guest_entitlements`, `guest_entitlements_missing`; author base was source-compared: production sources are unchanged; its runtime was not built or executed for this review. This changes test coverage, not production behavior, so an old-production failure is not required. The build reuses matching dependency source pins and the existing FFmpeg package; no full product or game execution is claimed.
MarcZX10 commented 2026-10-29 06:19:38 +00:00 (Migrated from github.com)

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

Review: APPROVED


Re-checked — approved

The unsupported null-initialization success assertion has been removed, so this test no longer codifies unmeasured initialization behavior. The remaining boundary tests match the existing documented emulator error expectations, with the PR/debt text retaining the limitation that console precedence is not measured. The author reports guest_entitlements passing 2/2 suites on the updated head and conventions passing.

Hosted Windows, eligibility, conventions, and labels pass; other product jobs are skipped. I did not rerun the test locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693643170 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11909#pullrequestreview-5693643170). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T06:19:38Z. **Review:** APPROVED --- ## Re-checked — approved The unsupported null-initialization success assertion has been removed, so this test no longer codifies unmeasured initialization behavior. The remaining boundary tests match the existing documented emulator error expectations, with the PR/debt text retaining the limitation that console precedence is not measured. The author reports `guest_entitlements` passing 2/2 suites on the updated head and conventions passing. Hosted Windows, eligibility, conventions, and labels pass; other product jobs are skipped. I did not rerun the test 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
boykopovar/AnyPS5!11909
No description provided.