test(libScePad): cover motion sensor, tilt correction, and orientation reset handle setters #13344
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13344"
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-10-30T13:08:18Z.
What
Adds unit test coverage in
core/libs/tests/GuestPad.cppfor controller handle state setters:scePadSetMotionSensorState: covers enabling and disabling motion sensors onhandle2(port 1), verifying through the read path (scePadReadState) that motion sample values are read back when enabled and zeroed when disabled, while verifying port 0 motion state remains untouched (per-port isolation); covers invalid handle rejection (PAD_ERROR_INVALID_HANDLE) for unknown (handle2 + 99) and negative (-1) handles.scePadSetTiltCorrectionState&scePadResetOrientation: covers orientation settling onhandle2throughSettleOrientationW(1)when disabled and enabled, verifying port 0 orientation settling is unaffected; covers invalid handle rejection for unknown and negative handles.Tested
python tools/check_conventions.py --base upstream/main --head HEAD: 0 findings.BUILD_TESTING=ON),ctest -R '^(guest_kernel_sys|guest_pad|unwind_record_bounds)'passed 27/27 clean across 3 runs.Checklist
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T13:15:56Z.
Review: COMMENTED
Tests run and reviewed — exact-head execution pending
The handle-validity assertions are registered and conventions pass, but this C++ test change has not yet been executed on its exact head.
What I ran
Reviewed head
42988003b2b8480aa8f51cce0a9c5c977df51b97against baseee9a9a66cffb77ba42781b66d764e96d22843554. Environment: Debian 12 x86-64, Python 3.11.2, Git 2.39.5. I did not build or compile.Results
guest_pad_testsincludestests/GuestPad.cppand is registered asguest_pad.Unedited local check output
Conventions:
Test-quality heuristic:
Findings
Blocking
None confirmed from the source review.
Non-blocking
The PR adds C++ assertions, so the exact-head test executable still needs to run. Hosted checks were queued when I checked; this review is a comment rather than an approval until execution evidence is available.
Sources
guest_padCMake registration at the reviewed base.Not verified
The
guest_padexecutable and other build-dependent tests were not run locally. No runtime result is available yet for this head.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T14:36:53Z.
Review: CHANGES_REQUESTED
Thanks for the test. As written it mostly repeats coverage that is already on main:
scePadSetTiltCorrectionState/scePadResetOrientation:CheckTiltCorrection(core/libs/tests/GuestPad.cpp:119-129) already checks valid and invalid handles and the effect on the settled orientation.scePadSetMotionSensorState: lines 881-883 already cover enable, disable and an invalid handle; 414-417 covers the special handle.What the new lines add is the same return codes on port 1 (
handle2) plus handle-1. None of them would fail if the setter changed the wrong port or stopped applying the state, because onlyPAD_OK/PAD_ERROR_INVALID_HANDLEis checked.To make it pin behaviour:
handle2and check the effect through the read path (for tilt correction,SettleOrientationW()like line 127-129; for motion, a published motion sample read back with motion off and on), andPortOf(handle)is there for).The
-1/ unknown handle rows are fine to keep.