test(input): the display-pointer fixture defines rx_option, which mouse_capture now asks (#178) #187
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!187
Loading…
Reference in a new issue
No description provided.
Delete branch "d4nkn3ss/Longshot:fix/test-display-pointer-rx-option"
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?
Why
tests/test_display_pointer.pyfails onmain: since #178 (Mouse camera Off) its fixture doesn't link, so the checks of the mouse pointer and capture code inhost/display.candhost/posix/display_sdl.caren't running.What changed
tests/display_pointer_test.cppdefinesrx_option(int, int)in both itswinandsdlnamespaces, returning the option's default. #178 mademouse_capture()in both display files askrx_option(6, 0)(Mouse camera), declared inside the function, so the pasted copies need it in their own namespace: without it,ld.lld: error: undefined symbol: win::rx_option(int, int).Flags and settings
None
Measurements
main:
000f19fb(2026-11-13)this PR: fix/test-display-pointer-rx-option @
840a9223Hardware: Windows 11, llvm-mingw clang 23 (the Longshot Builder's), Python 3.12
Scene: n/a (game-free)
Method:
python -I -B tests/run_all.py display_pointeron both sidesHow to reproduce: the command above, with clang++ on PATH
000f19fb840a9223tests/test_display_pointer.pyld.lld: error: undefined symbol: win::rx_option(int, int)Testing
Tested: the row above on Windows 11.
Full suite:
python -I -B tests/run_all.pyon this branch @840a9223, Windows 11: 486 passed, 2 failed, 33 skipped:tests/test_check_third_party.py(#80) andtests/test_release.py(#119, #144, #145), both failing onmainthe same way.Not tested: Linux: the check runs there too (no
RUN_ALL_SKIP) and itssdlcopy needs the same definition, added here; not run on Linux.Needs other testers: None
Screenshots
Nothing on screen
Risk and rollback
Test-only; reverting the commit is enough.
Issues
None
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Approve. The fix is right and still applies to current main.
What's good
int rx_option(int id, int otherwise)(host/rx_backend.c:502, which returnsotherwisewhen no renderer is attached). Returningotherwiseis also what the game does before the renderer is up.rx_option(6, 0)returns 0 (Mouse camera on), somouse_capture()takes its normal capture path, which is the path the check exercises. Nothing the check covered before is hidden.mouse_capture()declaresrx_optionat block scope, and that declaration resolves towin::rx_option.host/display.c,host/posix/display_sdl.c,tests/test_display_pointer.pyand the fixture have not changed on main@origin since this PR's base (main@origin is1ef93e79, the PR's base). It applies cleanly.Must change
Should change
sdlcopy isn't needed. The SDL fixture stubsmouse_capture(static void mouse_capture(int on){mouse_captured=on;}) rather than cutting it, and none of the SDL functions it cuts callrx_option. Since it's non-static it doesn't warn, so it does no harm, but the description says thesdlcopy "needs the same definition". Either drop it, or keep it and change the comment to say it's there for whenmouse_capturegets cut.rx_option(6, 0) == 2, where capture is refused) isn't tested anywhere. The stub could take a settable value so a case can check thatmouse_capture(1)does nothing when the option is Off.@ -127,6 +128,7 @@ constexpr uint32_t WM_APP=0x8000;#ifndef WM_CLOSEconstexpr uint32_t WM_CLOSE=0x0010;#endifint rx_option(int, int otherwise) { return otherwise; } // (the menu's options: defaults; mouse_capture asks Mouse camera, 6)This one is never used. The
sdlnamespace stubsmouse_capture(a few lines up) instead of cutting it, and none of the SDL functions the check cuts (hos_mouse_pointer,pointer_publish_at,pointer_update,drawable_size,sdl_button_bit,hos_posix_post_message,menu_mouse) callrx_option. It's harmless since it's non-static, but either drop it or say in the comment that it's there for whenmouse_capturegets cut, and fix the description, which says the sdl copy is needed.