diff options
Diffstat (limited to 'runtime/test/gameinput_test.cpp')
| -rw-r--r-- | runtime/test/gameinput_test.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/test/gameinput_test.cpp b/runtime/test/gameinput_test.cpp index 42a59e764..09d959f34 100644 --- a/runtime/test/gameinput_test.cpp +++ b/runtime/test/gameinput_test.cpp | |||
| @@ -1745,11 +1745,19 @@ int main(int argc, char** argv) { | |||
| 1745 | Sleep(350); | 1745 | Sleep(350); |
| 1746 | g_focus = true; | 1746 | g_focus = true; |
| 1747 | rt::gameinput::poll(); | 1747 | rt::gameinput::poll(); |
| 1748 | // A scripted press lasts its hold (300 ms, or button@seconds:hold) and then until the title has read the pads | ||
| 1749 | // six times since it began (update_keyboard_pad: kReads), so a title that polls slowly still sees it. Each | ||
| 1750 | // pad_state() is one GetCurrentReading, and this is the third since X and Y began. | ||
| 1751 | check(pad_state(input, nullptr).buttons == (GameInputGamepadX | GameInputGamepadB | GameInputGamepadY), | ||
| 1752 | "long script: past its 300 ms X is still held while the title has read the pads fewer than six times"); | ||
| 1753 | for (int i = 0; i < 6; ++i) pad_state(input, nullptr); | ||
| 1754 | rt::gameinput::poll(); | ||
| 1748 | check(pad_state(input, nullptr).buttons == (GameInputGamepadB | GameInputGamepadY), | 1755 | check(pad_state(input, nullptr).buttons == (GameInputGamepadB | GameInputGamepadY), |
| 1749 | "long script: X's 0.3 s press ends, y@0:0.6 is still held, the physical key stays held"); | 1756 | "long script: X ends once the title has read it, y@0:0.6 is still held for its time, the key stays held"); |
| 1750 | Sleep(400); | 1757 | Sleep(400); |
| 1751 | rt::gameinput::poll(); | 1758 | rt::gameinput::poll(); |
| 1752 | check(pad_state(input, nullptr).buttons == GameInputGamepadB, "long script: Y is released after its 0.6 s hold"); | 1759 | check(pad_state(input, nullptr).buttons == GameInputGamepadB, |
| 1760 | "long script: Y is released after its 0.6 s hold, the title having read it six times"); | ||
| 1753 | input->Release(); | 1761 | input->Release(); |
| 1754 | std::printf("%d checks, %d failures\n", g_checks, g_failures); | 1762 | std::printf("%d checks, %d failures\n", g_checks, g_failures); |
| 1755 | return g_failures ? 1 : 0; | 1763 | return g_failures ? 1 : 0; |