diff options
Diffstat (limited to 'runtime/test/gameinput_test.cpp')
| -rw-r--r-- | runtime/test/gameinput_test.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/test/gameinput_test.cpp b/runtime/test/gameinput_test.cpp index d1923ceaf..ba2a21f0e 100644 --- a/runtime/test/gameinput_test.cpp +++ b/runtime/test/gameinput_test.cpp | |||
| @@ -992,6 +992,17 @@ int main() { | |||
| 992 | check(input->GetPreviousReading(idle, GameInputKindGamepad, dev, nullptr) == E_POINTER && | 992 | check(input->GetPreviousReading(idle, GameInputKindGamepad, dev, nullptr) == E_POINTER && |
| 993 | input->GetPreviousReading(nullptr, GameInputKindGamepad, dev, &hit) == E_INVALIDARG && !hit, | 993 | input->GetPreviousReading(nullptr, GameInputKindGamepad, dev, &hit) == E_INVALIDARG && !hit, |
| 994 | "history: a null output is E_POINTER, a null reference E_INVALIDARG"); | 994 | "history: a null output is E_POINTER, a null reference E_INVALIDARG"); |
| 995 | // GetTemporalReading: E_NOTIMPL with a null reading, as GameInput v0 itself, for a timestamp in the history, one | ||
| 996 | // before it and the current time, with and without a device filter. | ||
| 997 | const uint64_t idle_us = idle->GetTimestamp(); | ||
| 998 | bool temporal_notimpl = true; | ||
| 999 | for (const uint64_t at : {idle_us, idle_us - 1'000'000, input->GetCurrentTimestamp()}) | ||
| 1000 | for (IGameInputDevice* filter : {dev, static_cast<IGameInputDevice*>(nullptr)}) { | ||
| 1001 | IGameInputReading* temporal = idle; // a stale value the call must clear | ||
| 1002 | temporal_notimpl &= input->GetTemporalReading(at, filter, &temporal) == E_NOTIMPL && !temporal; | ||
| 1003 | } | ||
| 1004 | check(temporal_notimpl && input->GetTemporalReading(idle_us, dev, nullptr) == E_POINTER, | ||
| 1005 | "history: GetTemporalReading is E_NOTIMPL with a null reading, as in GameInput v0"); | ||
| 995 | 1006 | ||
| 996 | // Two pads in one stream, one poll each: A on the Xbox pad, B on the DualSense, Y on the Xbox pad. | 1007 | // Two pads in one stream, one poll each: A on the Xbox pad, B on the DualSense, Y on the Xbox pad. |
| 997 | IGameInputReading* start = current(input, dev); | 1008 | IGameInputReading* start = current(input, dev); |