test(libSceRtc): cover null pointer validation in current tick getters #12222

Merged
al3w0f205 merged 1 commit from upstream-pr/12222 into main 2026-10-29 06:45:03 +00:00
al3w0f205 commented 2026-10-28 03:51:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by al3w0f205 on 2026-10-28T03:51:50Z.


What

Add test coverage in GuestRtc.cpp for null pointer validation in current tick getters:

  • Rejection of nullptr tick pointer in sceRtcGetCurrentTick with invalidPointer
  • Rejection of nullptr tick pointer in sceRtcGetCurrentNetworkTick with invalidPointer
  • Rejection of nullptr tick pointer in sceRtcGetCurrentRawNetworkTick with invalidPointer
  • Rejection of nullptr tick pointer in sceRtcGetCurrentAdNetworkTick with invalidPointer
  • Rejection of nullptr tick pointer in sceRtcGetCurrentDebugNetworkTick with invalidPointer

Tested

  • Windows 11 x64, checked with python tools/check_conventions.py --base origin/main (all conventions checks passed) and git diff --check (clean).
  • Focused test execution: ctest -R guest_rtc (1/1 test passed, 0 failures).

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:5044925256 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12222). Originally posted by [al3w0f205](https://github.com/al3w0f205) on 2026-10-28T03:51:50Z. --- ### What Add test coverage in `GuestRtc.cpp` for null pointer validation in current tick getters: - Rejection of `nullptr` tick pointer in `sceRtcGetCurrentTick` with `invalidPointer` - Rejection of `nullptr` tick pointer in `sceRtcGetCurrentNetworkTick` with `invalidPointer` - Rejection of `nullptr` tick pointer in `sceRtcGetCurrentRawNetworkTick` with `invalidPointer` - Rejection of `nullptr` tick pointer in `sceRtcGetCurrentAdNetworkTick` with `invalidPointer` - Rejection of `nullptr` tick pointer in `sceRtcGetCurrentDebugNetworkTick` with `invalidPointer` ### 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 x64, checked with `python tools/check_conventions.py --base origin/main` (all conventions checks passed) and `git diff --check` (clean). - Focused test execution: `ctest -R guest_rtc` (1/1 test passed, 0 failures). ### 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-28 04:12:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T04:12:59Z.

Review: CHANGES_REQUESTED


The five added null-output checks match the current implementations, each of which returns SCE_RTC_ERROR_INVALID_POINTER before dereferencing the output. I built the exact changed test source and ran guest_rtc; it passed 1/1 in the isolated review build with only the unrelated host CPU startup gate bypassed. The ordinary host run cannot reach assertions on this Xeon. Hosted Windows passed, the rerun of Conventions passed, and Linux was skipped by CI.

Please update the branch to current main and rerun affected checks, as required by CONTRIBUTING. It is 42 commits behind 7fe69e276fc4e000ccb2a360ea8faeb3d7fcc137; intervening main changes do not touch GuestRtc.cpp, and the merge preview is clean. The PR body also omits the required third-party-submodule checklist line and gives only platform checkboxes rather than the OS, focused command and result. Please restore every template line and record the test details before approval. I found no functional issue in these assertions.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5677705911 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12222#pullrequestreview-5677705911). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T04:12:59Z. **Review:** CHANGES_REQUESTED --- The five added null-output checks match the current implementations, each of which returns `SCE_RTC_ERROR_INVALID_POINTER` before dereferencing the output. I built the exact changed test source and ran `guest_rtc`; it passed 1/1 in the isolated review build with only the unrelated host CPU startup gate bypassed. The ordinary host run cannot reach assertions on this Xeon. Hosted Windows passed, the rerun of Conventions passed, and Linux was skipped by CI. Please update the branch to current `main` and rerun affected checks, as required by CONTRIBUTING. It is 42 commits behind `7fe69e276fc4e000ccb2a360ea8faeb3d7fcc137`; intervening main changes do not touch `GuestRtc.cpp`, and the merge preview is clean. The PR body also omits the required third-party-submodule checklist line and gives only platform checkboxes rather than the OS, focused command and result. Please restore every template line and record the test details before approval. I found no functional issue in these assertions.
MarcZX10 commented 2026-10-28 04:44:05 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


The Windows job successfully linked the changed host-only test executable, but the test-selection and CTest steps were skipped. The description reports only conventions and git diff --check; it does not report running the new null-output assertions. Please run the focused RTC test on this head and add the exact command/result before approval. I checked current Export.cpp; all five getters return the same invalid-pointer code for null output.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5677883025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12222#pullrequestreview-5677883025). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T04:44:05Z. **Review:** CHANGES_REQUESTED --- The Windows job successfully linked the changed host-only test executable, but the test-selection and CTest steps were skipped. The description reports only conventions and `git diff --check`; it does not report running the new null-output assertions. Please run the focused RTC test on this head and add the exact command/result before approval. I checked current `Export.cpp`; all five getters return the same invalid-pointer code for null output.
MarcZX10 commented 2026-10-29 06:43:00 +00:00 (Migrated from github.com)

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

Review: APPROVED


Re-reviewed — approved

I reviewed exact head 994049e8bf8203b32e01e6ae299229b8c8f61abf against current main 2960e9a6e7e1fc99c4ed180c71495b5eb83464c7.

What I ran

  • Inspected the five new null-output assertions in GuestRtc.cpp and checked that current main has no later change to that file since the PR's base.
  • Ran git merge-tree --write-tree refs/remotes/upstream/main refs/review/upstream-12222; clean tree 429aeb5f6f77e786b08a7587aee9d072296c1775.
  • Ran git diff --check refs/remotes/upstream/main...refs/review/upstream-12222; exit 0, no output.
  • I did not run a local C++ build or CTest.

Results

Check Result
Current-main merge preview Clean
Diff check Pass
Focused RTC test Author reports ctest -R guest_rtc passed 1/1 on Windows 11
Hosted checks Windows and conventions pass; product tests are path-skipped

Negative control

This test-only change has no separate negative control reported. I did not run one locally.

Findings

Blocking

None. The updated Tested section now records the focused command and result requested in my previous review, and the assertions match the null-output checks in all five getters.

Non-blocking

I did not independently execute the RTC test; the focused result is author-reported.

Sources

Not verified

I did not independently build or run CTest. The focused 1/1 result and Windows environment are author-reported.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693827061 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12222#pullrequestreview-5693827061). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T06:43:00Z. **Review:** APPROVED --- # Re-reviewed — approved I reviewed exact head `994049e8bf8203b32e01e6ae299229b8c8f61abf` against current `main` `2960e9a6e7e1fc99c4ed180c71495b5eb83464c7`. ## What I ran - Inspected the five new null-output assertions in `GuestRtc.cpp` and checked that current `main` has no later change to that file since the PR's base. - Ran `git merge-tree --write-tree refs/remotes/upstream/main refs/review/upstream-12222`; clean tree `429aeb5f6f77e786b08a7587aee9d072296c1775`. - Ran `git diff --check refs/remotes/upstream/main...refs/review/upstream-12222`; exit 0, no output. - I did not run a local C++ build or CTest. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | Diff check | Pass | | Focused RTC test | Author reports `ctest -R guest_rtc` passed 1/1 on Windows 11 | | Hosted checks | Windows and conventions pass; product tests are path-skipped | ## Negative control This test-only change has no separate negative control reported. I did not run one locally. ## Findings ### Blocking None. The updated `Tested` section now records the focused command and result requested in my previous review, and the assertions match the null-output checks in all five getters. ### Non-blocking I did not independently execute the RTC test; the focused result is author-reported. ## Sources - [New RTC assertions at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/994049e8bf8203b32e01e6ae299229b8c8f61abf/core/libs/tests/GuestRtc.cpp) - [Current RTC implementation](https://github.com/boykopovar/AnyPS5/tree/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/core/libs/prx/libSceRtc) - [Current contribution rules](https://github.com/boykopovar/AnyPS5/blob/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/CONTRIBUTING.md) ## Not verified I did not independently build or run CTest. The focused 1/1 result and Windows environment are author-reported.
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!12222
No description provided.