[PATCH libinput 03/12] test: skip two tests when middle button is missing

Peter Hutterer peter.hutterer at who-t.net
Mon Feb 20 20:53:30 UTC 2017


And disable middle button emulation for this test, it would mess with the test
results.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/test-pointer.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/test-pointer.c b/test/test-pointer.c
index abc8a11..d4d2607 100644
--- a/test/test-pointer.c
+++ b/test/test-pointer.c
@@ -952,6 +952,11 @@ START_TEST(pointer_left_handed_during_click_multiple_buttons)
 	struct libinput *li = dev->libinput;
 	enum libinput_config_status status;
 
+	if (!libinput_device_pointer_has_button(d, BTN_MIDDLE))
+		return;
+
+	litest_disable_middleemu(dev);
+
 	litest_drain_events(li);
 	litest_button_click(dev, BTN_LEFT, 1);
 	libinput_dispatch(li);
@@ -1046,6 +1051,11 @@ START_TEST(pointer_scroll_button_no_event_before_timeout)
 	struct libinput *li = device->libinput;
 	int i;
 
+	if (!libinput_device_pointer_has_button(device->libinput_device,
+						BTN_MIDDLE))
+		return;
+
+	litest_disable_middleemu(device);
 	disable_button_scrolling(device);
 
 	libinput_device_config_scroll_set_method(device->libinput_device,
-- 
2.9.3



More information about the wayland-devel mailing list