summaryrefslogtreecommitdiff
path: root/test/test-touchpad.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-01-12 13:30:08 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-01-30 10:50:28 +1000
commit2b3fe1a73ebbea1f051869ac9abfa3e8f4bcfab5 (patch)
tree4403413476f31bf82605d3674d1209ef6e2e6712 /test/test-touchpad.c
parentc27f9afffc19f5a259e026df912a6a283cb69a4b (diff)
test: add the right pressure bits.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test/test-touchpad.c')
-rw-r--r--test/test-touchpad.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test-touchpad.c b/test/test-touchpad.c
index b8ca0b97..75750332 100644
--- a/test/test-touchpad.c
+++ b/test/test-touchpad.c
@@ -1686,6 +1686,7 @@ START_TEST(touchpad_semi_mt_hover_down)
litest_event(dev, EV_ABS, ABS_X, x + 100);
litest_event(dev, EV_ABS, ABS_Y, y + 100);
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 50);
litest_event(dev, EV_KEY, BTN_TOUCH, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
@@ -1712,6 +1713,7 @@ START_TEST(touchpad_semi_mt_hover_down)
/* go back to hover */
hover_continue(dev, 0, x, y);
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 0);
litest_event(dev, EV_KEY, BTN_TOUCH, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
@@ -1752,6 +1754,7 @@ START_TEST(touchpad_semi_mt_hover_down_hover_down)
/* touch */
litest_event(dev, EV_ABS, ABS_X, x + 100);
litest_event(dev, EV_ABS, ABS_Y, y + 100);
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 50);
litest_event(dev, EV_KEY, BTN_TOUCH, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
@@ -1773,6 +1776,7 @@ START_TEST(touchpad_semi_mt_hover_down_hover_down)
/* go back to hover */
hover_continue(dev, 0, x, y);
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 0);
litest_event(dev, EV_KEY, BTN_TOUCH, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
@@ -1796,7 +1800,10 @@ START_TEST(touchpad_semi_mt_hover_down_hover_down)
litest_assert_empty_queue(li);
/* start a new touch to be sure */
+ litest_push_event_frame(dev);
litest_touch_down(dev, 0, 50, 50);
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 50);
+ litest_pop_event_frame(dev);
litest_touch_move_to(dev, 0, 50, 50, 70, 70, 10, 10);
litest_touch_up(dev, 0);
@@ -1845,6 +1852,7 @@ START_TEST(touchpad_semi_mt_hover_down_up)
litest_assert_empty_queue(li);
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 50);
litest_event(dev, EV_KEY, BTN_TOUCH, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
libinput_dispatch(li);
@@ -1930,6 +1938,7 @@ START_TEST(touchpad_semi_mt_hover_2fg_1fg_down)
/* two slots active, but BTN_TOOL_FINGER only */
hover_start(dev, 0, x, y);
hover_start(dev, 1, x + 500, y + 500);
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 50);
litest_event(dev, EV_KEY, BTN_TOUCH, 1);
litest_event(dev, EV_KEY, BTN_TOOL_FINGER, 1);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
@@ -1948,6 +1957,7 @@ START_TEST(touchpad_semi_mt_hover_2fg_1fg_down)
litest_event(dev, EV_SYN, SYN_REPORT, 0);
}
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 0);
litest_event(dev, EV_KEY, BTN_TOUCH, 0);
litest_event(dev, EV_KEY, BTN_TOOL_FINGER, 0);
litest_event(dev, EV_SYN, SYN_REPORT, 0);
@@ -1969,6 +1979,7 @@ START_TEST(touchpad_semi_mt_hover_2fg_up)
litest_push_event_frame(dev);
litest_touch_move(dev, 0, 72, 50);
litest_touch_move(dev, 1, 52, 50);
+ litest_event(dev, EV_ABS, ABS_PRESSURE, 0);
litest_event(dev, EV_KEY, BTN_TOUCH, 0);
litest_pop_event_frame(dev);