mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-09 05:58:01 +02:00
test: fix middle button defaults test
This failed on devices without a middle button, we just didn't have a test device to trigger this. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
42b68397f9
commit
9ab05b0bfd
1 changed files with 7 additions and 8 deletions
|
|
@ -1742,22 +1742,21 @@ START_TEST(middlebutton_default_enabled)
|
||||||
struct libinput_device *device = dev->libinput_device;
|
struct libinput_device *device = dev->libinput_device;
|
||||||
enum libinput_config_status status;
|
enum libinput_config_status status;
|
||||||
int available;
|
int available;
|
||||||
enum libinput_config_middle_emulation_state deflt, state;
|
enum libinput_config_middle_emulation_state state;
|
||||||
|
|
||||||
|
if (!libinput_device_pointer_has_button(dev->libinput_device,
|
||||||
|
BTN_MIDDLE))
|
||||||
|
return;
|
||||||
|
|
||||||
available = libinput_device_config_middle_emulation_is_available(device);
|
available = libinput_device_config_middle_emulation_is_available(device);
|
||||||
ck_assert(available);
|
ck_assert(available);
|
||||||
|
|
||||||
if (libinput_device_pointer_has_button(device, BTN_MIDDLE))
|
|
||||||
deflt = LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED;
|
|
||||||
else
|
|
||||||
deflt = LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED;
|
|
||||||
|
|
||||||
state = libinput_device_config_middle_emulation_get_enabled(device);
|
state = libinput_device_config_middle_emulation_get_enabled(device);
|
||||||
ck_assert_int_eq(state, deflt);
|
ck_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED);
|
||||||
|
|
||||||
state = libinput_device_config_middle_emulation_get_default_enabled(
|
state = libinput_device_config_middle_emulation_get_default_enabled(
|
||||||
device);
|
device);
|
||||||
ck_assert_int_eq(state, deflt);
|
ck_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED);
|
||||||
|
|
||||||
status = libinput_device_config_middle_emulation_set_enabled(device,
|
status = libinput_device_config_middle_emulation_set_enabled(device,
|
||||||
LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED);
|
LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue