aboutsummaryrefslogtreecommitdiff
path: root/tests/pointing/test_pointing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pointing/test_pointing.cpp')
-rw-r--r--tests/pointing/test_pointing.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/pointing/test_pointing.cpp b/tests/pointing/test_pointing.cpp
index d59d014925..bd886b18a2 100644
--- a/tests/pointing/test_pointing.cpp
+++ b/tests/pointing/test_pointing.cpp
@@ -12,6 +12,26 @@ using testing::_;
class Pointing : public TestFixture {};
class PointingButtonsViaMousekeysParametrized : public ::testing::WithParamInterface<std::pair<KeymapKey, uint8_t>>, public Pointing {};
+TEST_F(Pointing, NoMovementOnInitFailure) {
+ TestDriver driver;
+
+ pointing_device_set_status(POINTING_DEVICE_STATUS_INIT_FAILED);
+ pd_set_x(-50);
+ pd_set_y(100);
+ EXPECT_NO_MOUSE_REPORT(driver);
+ run_one_scan_loop();
+
+ pointing_device_set_status(POINTING_DEVICE_STATUS_SUCCESS);
+ EXPECT_MOUSE_REPORT(driver, (-50, 100, 0, 0, 0));
+ run_one_scan_loop();
+
+ pd_clear_movement();
+ // EXPECT_EMPTY_MOUSE_REPORT(driver);
+ run_one_scan_loop();
+
+ VERIFY_AND_CLEAR(driver);
+}
+
TEST_F(Pointing, SendMouseIsNotCalledWithNoInput) {
TestDriver driver;
EXPECT_NO_MOUSE_REPORT(driver);