Repository navigation
Tests: the host GameInput.dll path from mapped code - #2420
Conversation
|
Verified on Windows: built with MSVC 19.44.35228.0 + SDK 10.0.26100.0 and ran the focused CTest. 1/1 passed, 0 skipped; test output 4 PASS. It ran against the real host Two nits and one real defect:
Mergeable once the Debug link failure is fixed or explicitly waived. Release/CI is clean. |
|
Ran this on
Minor: the fixture sets AI-assisted (Claude Code). |
|
Tested d43bb93 on RTX 3060, driver 617.14, Windows 11, MSVC 14.44 RelWithDebInfo: pass
AI-assisted. |
docs/gameinput.md says that without the SDL3 shim the loader binds GameInputCreate to the host's GameInput.dll, but nothing tested it. gameinput_host_test maps a CRT-free fixture DLL built against the SDK's gameinput.lib and checks that the import binds to the host copy (the test links no shim table), that GameInputCreate and GetCurrentTimestamp work from mapped code, that GetCurrentReading answers, and, with a pad attached, that GetGamepadState succeeds. It skips (77) where there is no GameInput.dll, and is only built when gameinput.lib is found. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
d43bb93 to
37e6d48
Compare
|
Pushed 37e6d48: rebased onto AI-assisted (Claude Code). No game files. |
… present (review) - gameinput_host_test decides the skip before mapping: LoadLibraryExW of GameInput.dll from System32. Only "not found" skips (77); an import that then binds to nothing is a failure. Breaking host ordinal binding in Loader::resolve now fails the test (4 failures) instead of skipping. - The gameinput_host fixture links in Debug: /RTC1 with /NODEFAULTLIB left _RTC_InitBase, _RTC_Shutdown and _RTC_CheckStackVars unresolved, so the fixture defines them as no-ops when runtime checks are on. - The fixture reports E_FAIL, not S_OK, when GameInputCreate fails, and the test counts a gamepad as attached only when the library was created. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks @JRamos1993, all three are in; pushed a41173a (on top of the rebase 37e6d48, one extra commit).
Tested on Windows 11 build 26300, MSVC 19.44, AMD Radeon RX 9060 XT (driver 32.0.32029.2010), no gamepad attached: Release and Debug builds, AI-assisted (Claude Code). No game files. |
Claim: #2300 (comment) (new item: a test for the host
GameInput.dllpath)AI-assisted (Claude), tested by running the code below on Windows; see "Tested".
Problem
docs/gameinput.mdsays that without the SDL3 shim the loader bindsGameInputCreateto the host'sGameInput.dll(#279), andruntime/CMakeLists.txtrepeats it. No test covers that path:gameinput_testexercises the shim, and the shim is not built when SDL3 is missing, which is the default configuration.Change
A test only, plus one paragraph of docs:
test/fixtures/gameinput_host.cpp: a CRT-free DLL built against the SDK'sGameInput.handgameinput.lib(soGameInputCreateis imported fromGameInput.dll, by ordinal, as a title's import would be). Its export callsGameInputCreate,GetCurrentTimestamp,GetCurrentReadingand, when a pad gives a reading,GetGamepadState.test/gameinput_host_test.cpp(ctestgameinput_host) maps it withrt::Loaderand checks that the import binds to the host's copy (the test links no shim table, so it cannot be a shim), thatGameInputCreatesucceeds from mapped code, that the library returns a timestamp, and thatGetCurrentReadingreturns either success orGAMEINPUT_E_READING_NOT_FOUND. It passes with or without a pad attached.GameInput.dllon the machine, and is only configured whengameinput.libis found in the Windows SDK.docs/gameinput.mdsays the path is now tested, and what the test checks.Tested
Windows 11 (build 26300,
GameInput.dll0.2309.26100.9818), MSVC 19.44 (VS 2022 Build Tools, Visual Studio generator, Release), AMD Radeon RX 9060 XT, driver 32.0.32029.2010. Base:49475796(main).ctest --test-dir runtime/build -C Releaseon this branch: 117 run, 111 passed, 6 skipped (five need the package,vk_sync_validationskips itself), 0 failed.gameinput(the SDL3 shim's test) is disabled because SDL3 is not installed here.gameinput_host_testhere, no pad attached: all checks pass (GameInputCreatereturnsS_OK, a non-zero timestamp, reading0x838A0003). An earlier C build of the same fixture, run with a gamepad attached, also passed: a reading came back andGetGamepadStatesucceeded.