mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 13:38:40 +02:00
test: fix the pointer scroll-defaults test
The button-scroll by default behavior is only true on devices with a middle button. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
72c5821a3b
commit
53e263fce7
1 changed files with 16 additions and 7 deletions
|
|
@ -1136,19 +1136,28 @@ START_TEST(pointer_scroll_nowheel_defaults)
|
||||||
{
|
{
|
||||||
struct litest_device *dev = litest_current_device();
|
struct litest_device *dev = litest_current_device();
|
||||||
struct libinput_device *device = dev->libinput_device;
|
struct libinput_device *device = dev->libinput_device;
|
||||||
enum libinput_config_scroll_method method;
|
enum libinput_config_scroll_method method, expected;
|
||||||
uint32_t button;
|
uint32_t button;
|
||||||
|
|
||||||
|
/* button scrolling is only enabled if there is a
|
||||||
|
middle button present */
|
||||||
|
if (libinput_device_pointer_has_button(device, BTN_MIDDLE))
|
||||||
|
expected = LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN;
|
||||||
|
else
|
||||||
|
expected = LIBINPUT_CONFIG_SCROLL_NO_SCROLL;
|
||||||
|
|
||||||
method = libinput_device_config_scroll_get_method(device);
|
method = libinput_device_config_scroll_get_method(device);
|
||||||
ck_assert_int_eq(method, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN);
|
ck_assert_int_eq(method, expected);
|
||||||
|
|
||||||
method = libinput_device_config_scroll_get_default_method(device);
|
method = libinput_device_config_scroll_get_default_method(device);
|
||||||
ck_assert_int_eq(method, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN);
|
ck_assert_int_eq(method, expected);
|
||||||
|
|
||||||
button = libinput_device_config_scroll_get_button(device);
|
if (method == LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN) {
|
||||||
ck_assert_int_eq(button, BTN_MIDDLE);
|
button = libinput_device_config_scroll_get_button(device);
|
||||||
button = libinput_device_config_scroll_get_default_button(device);
|
ck_assert_int_eq(button, BTN_MIDDLE);
|
||||||
ck_assert_int_eq(button, BTN_MIDDLE);
|
button = libinput_device_config_scroll_get_default_button(device);
|
||||||
|
ck_assert_int_eq(button, BTN_MIDDLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue