test(libkernel): cover invalid clock ID in clock_gettime #14618
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14618"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-11-01T16:26:02Z.
What
Validate clock IDs in clock_gettime_nid_postfix so that out-of-bounds IDs (< 0 and not CPU clock, or >= 32) return -1 with errno EINVAL (22), and add test coverage for invalid clock IDs (-1, 999) returning EINVAL / SCE_KERNEL_ERROR_EINVAL in GuestFreebsdClocks.cpp.
Tested
Ran python tools/check_conventions.py --base upstream/main --head HEAD with 0 findings.
Checklist
NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T16:33:29Z.
Review: COMMENTED
Reviewed — no blocking findings
I reviewed head
4e913b7444674e75fd2b21512b314f12d2c18cae; the invalid-ID path and its assertions are consistent, but hosted checks remain queued.What I ran
Base:
f2d874c1fdccf781c0fa5d86619bb5dd8894b958(main); stack preview merged cleanly. Environment: Debian 12, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run.I read both changed files and verified the existing CMake registration. The precheck's two helper invocations failed because its detached snapshot lacks the workspace-only scripts; I ran both helpers separately against the exact head.
Results
Precheck report check table (verbatim)
Negative control
Not run: the changed C++ behavior requires an exact-head binary. The new test checks both the direct libc-style result (
-1andEINVAL) and the guest wrapper error, and checks that the output remains unchanged.Findings
Blocking
None found in the two changed files.
Non-blocking
The test-quality heuristic does not recognize the existing macro-based registration;
core/libs/prx/libkernel/CMakeLists.txtregistersGuestFreebsdClocks.cppasguest_freebsd_clocks.Sources
Not verified
I did not build or execute this C++ test, nor verify behavior on Windows, macOS, or a console. Hosted CI was queued at review time.
To get this to a good state
No code change is indicated. Allow the six hosted checks to complete; I will recheck the exact head and results before approving.