upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/gameinput_test.cpp
diff options
context:
space:
mode:
authorItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 11:43:15 -0500
committerItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 11:43:15 -0500
commit873a952a37f50abcd6f4cdb1dfec50b50041732f (patch)
treeb4bd0fb2c07f865a8bbe63f8d36764973ca47e48 /runtime/test/gameinput_test.cpp
parent2e0c95ff2621d9f1770f4c6ed134fee7cc1b05a8 (diff)
parentb9a3cbcfc006c8fb957f7dc7cbe8cb450adabb51 (diff)
Merge pull request #2239 from itsRevela
Diffstat (limited to 'runtime/test/gameinput_test.cpp')
-rw-r--r--runtime/test/gameinput_test.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/test/gameinput_test.cpp b/runtime/test/gameinput_test.cpp
index d7da81b60..a65b444a1 100644
--- a/runtime/test/gameinput_test.cpp
+++ b/runtime/test/gameinput_test.cpp
@@ -1107,6 +1107,17 @@ int main() {
1107 check(input->GetPreviousReading(idle, GameInputKindGamepad, dev, nullptr) == E_POINTER && 1107 check(input->GetPreviousReading(idle, GameInputKindGamepad, dev, nullptr) == E_POINTER &&
1108 input->GetPreviousReading(nullptr, GameInputKindGamepad, dev, &hit) == E_INVALIDARG && !hit, 1108 input->GetPreviousReading(nullptr, GameInputKindGamepad, dev, &hit) == E_INVALIDARG && !hit,
1109 "history: a null output is E_POINTER, a null reference E_INVALIDARG"); 1109 "history: a null output is E_POINTER, a null reference E_INVALIDARG");
1110 // GetTemporalReading: E_NOTIMPL with a null reading, as GameInput v0 itself, for a timestamp in the history, one
1111 // before it and the current time, with and without a device filter.
1112 const uint64_t idle_us = idle->GetTimestamp();
1113 bool temporal_notimpl = true;
1114 for (const uint64_t at : {idle_us, idle_us - 1'000'000, input->GetCurrentTimestamp()})
1115 for (IGameInputDevice* filter : {dev, static_cast<IGameInputDevice*>(nullptr)}) {
1116 IGameInputReading* temporal = idle; // a stale value the call must clear
1117 temporal_notimpl &= input->GetTemporalReading(at, filter, &temporal) == E_NOTIMPL && !temporal;
1118 }
1119 check(temporal_notimpl && input->GetTemporalReading(idle_us, dev, nullptr) == E_POINTER,
1120 "history: GetTemporalReading is E_NOTIMPL with a null reading, as in GameInput v0");
1110 1121
1111 // Two pads in one stream, one poll each: A on the Xbox pad, B on the DualSense, Y on the Xbox pad. 1122 // Two pads in one stream, one poll each: A on the Xbox pad, B on the DualSense, Y on the Xbox pad.
1112 IGameInputReading* start = current(input, dev); 1123 IGameInputReading* start = current(input, dev);