aboutsummaryrefslogtreecommitdiffstats
path: root/tests/pointing/test_pointing.cpp
diff options
context:
space:
mode:
authorNick Brassel2025-09-06 09:55:23 +0200
committerNick Brassel2025-09-06 09:55:23 +0200
commit0188038bc0cfecdd6d413086634af4e5806c1ad7 (patch)
tree03bdd000530476ef4fc9e1242d62022405df21e7 /tests/pointing/test_pointing.cpp
parent1a58fce043e7f2e2b938dee03945dabc29e48d73 (diff)
parent2a4b9f79fd32a41fd157cba83293ece995523b45 (diff)
Merge branch 'develop'
Diffstat (limited to 'tests/pointing/test_pointing.cpp')
-rw-r--r--tests/pointing/test_pointing.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/pointing/test_pointing.cpp b/tests/pointing/test_pointing.cpp
index d59d014925..6de6ad30f0 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);
@@ -111,7 +131,7 @@ TEST_F(Pointing, CorrectButtonIsReportedWhenPressed) {
TEST_F(Pointing, CorrectButtonIsReportedWhenKeyPressed) {
TestDriver driver;
- auto key = KeymapKey(0, 0, 0, KC_MS_BTN1);
+ auto key = KeymapKey(0, 0, 0, QK_MOUSE_BUTTON_1);
set_keymap({key});
EXPECT_MOUSE_REPORT(driver, (0, 0, 0, 0, 1));