diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2024-09-16 16:49:38 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2024-10-15 12:44:27 +1000 |
commit | bd62da11e4142a2c60badec9ed658bfa5fd9b390 (patch) | |
tree | fda44adffdd2a909604e11da125beefcb98a1d53 /test | |
parent | 151c2feae683c9c208216b43089de7d35dd90ffa (diff) |
test: switch the tests to use enum comparisons
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1059>
Diffstat (limited to 'test')
-rw-r--r-- | test/test-device.c | 84 | ||||
-rw-r--r-- | test/test-gestures.c | 24 | ||||
-rw-r--r-- | test/test-keyboard.c | 18 | ||||
-rw-r--r-- | test/test-log.c | 2 | ||||
-rw-r--r-- | test/test-pad.c | 8 | ||||
-rw-r--r-- | test/test-pointer.c | 158 | ||||
-rw-r--r-- | test/test-switch.c | 12 | ||||
-rw-r--r-- | test/test-tablet.c | 152 | ||||
-rw-r--r-- | test/test-totem.c | 30 | ||||
-rw-r--r-- | test/test-touch.c | 8 | ||||
-rw-r--r-- | test/test-touchpad-buttons.c | 50 | ||||
-rw-r--r-- | test/test-touchpad-tap.c | 120 | ||||
-rw-r--r-- | test/test-touchpad.c | 94 | ||||
-rw-r--r-- | test/test-trackball.c | 14 | ||||
-rw-r--r-- | test/test-trackpoint.c | 14 | ||||
-rw-r--r-- | test/test-udev.c | 4 |
16 files changed, 396 insertions, 396 deletions
diff --git a/test/test-device.c b/test/test-device.c index 7cab7238..e45eeb69 100644 --- a/test/test-device.c +++ b/test/test-device.c @@ -57,7 +57,7 @@ START_TEST(device_sendevents_config_invalid) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED | bit(4)); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST @@ -101,11 +101,11 @@ START_TEST(device_sendevents_config_touchpad_superset) status = libinput_device_config_send_events_set_mode(device, modes); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* DISABLED supersedes the rest, expect the rest to be dropped */ modes = libinput_device_config_send_events_get_mode(device); - litest_assert_int_eq(modes, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); + litest_assert_enum_eq(modes, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); } END_TEST @@ -118,11 +118,11 @@ START_TEST(device_sendevents_config_default) device = dev->libinput_device; mode = libinput_device_config_send_events_get_mode(device); - litest_assert_int_eq(mode, + litest_assert_enum_eq(mode, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); mode = libinput_device_config_send_events_get_default_mode(device); - litest_assert_int_eq(mode, + litest_assert_enum_eq(mode, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); } END_TEST @@ -142,7 +142,7 @@ START_TEST(device_disable) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* no event from disabling */ litest_assert_empty_queue(li); @@ -161,7 +161,7 @@ START_TEST(device_disable) /* no event from resuming */ status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_empty_queue(li); /* event from re-enabled device */ @@ -171,7 +171,7 @@ START_TEST(device_disable) litest_dispatch(li); event = libinput_get_event(li); litest_assert_notnull(event); - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_POINTER_MOTION); libinput_event_destroy(event); @@ -197,7 +197,7 @@ START_TEST(device_disable_tablet) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* no event from disabling */ litest_assert_empty_queue(li); @@ -214,7 +214,7 @@ START_TEST(device_disable_tablet) /* no event from resuming */ status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_empty_queue(li); } END_TEST @@ -232,7 +232,7 @@ START_TEST(device_disable_touchpad) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* no event from disabling */ litest_assert_empty_queue(li); @@ -246,7 +246,7 @@ START_TEST(device_disable_touchpad) /* no event from resuming */ status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_empty_queue(li); } END_TEST @@ -264,7 +264,7 @@ START_TEST(device_disable_touch) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* no event from disabling */ litest_assert_empty_queue(li); @@ -278,7 +278,7 @@ START_TEST(device_disable_touch) /* no event from resuming */ status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_empty_queue(li); } END_TEST @@ -299,7 +299,7 @@ START_TEST(device_disable_touch_during_touch) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* after disabling sendevents we require a touch up */ litest_dispatch(li); @@ -325,7 +325,7 @@ START_TEST(device_disable_touch_during_touch) /* no event from resuming */ status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_empty_queue(li); } END_TEST @@ -353,12 +353,12 @@ START_TEST(device_disable_events_pending) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* expect above events */ litest_wait_for_event(li); while ((event = libinput_get_event(li)) != NULL) { - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_POINTER_MOTION); libinput_event_destroy(event); } @@ -378,11 +378,11 @@ START_TEST(device_double_disable) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_empty_queue(li); } @@ -401,11 +401,11 @@ START_TEST(device_double_enable) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_empty_queue(li); } @@ -426,7 +426,7 @@ START_TEST(device_reenable_syspath_changed) libinput_device_ref(device1); status = libinput_device_config_send_events_set_mode(device1, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -437,7 +437,7 @@ START_TEST(device_reenable_syspath_changed) status = libinput_device_config_send_events_set_mode(device1, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* can't really check for much here, other than that if we pump events through libinput, none of them should be from the first @@ -472,7 +472,7 @@ START_TEST(device_reenable_device_removed) libinput_device_ref(device); status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -481,7 +481,7 @@ START_TEST(device_reenable_device_removed) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* can't really check for much here, this really just exercises the code path. */ @@ -508,17 +508,17 @@ START_TEST(device_disable_release_buttons) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_wait_for_event(li); event = libinput_get_event(li); - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_POINTER_BUTTON); ptrevent = libinput_event_get_pointer_event(event); litest_assert_int_eq(libinput_event_pointer_get_button(ptrevent), (unsigned int)BTN_LEFT); - litest_assert_int_eq(libinput_event_pointer_get_button_state(ptrevent), + litest_assert_enum_eq(libinput_event_pointer_get_button_state(ptrevent), LIBINPUT_BUTTON_STATE_RELEASED); libinput_event_destroy(event); @@ -542,17 +542,17 @@ START_TEST(device_disable_release_keys) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_wait_for_event(li); event = libinput_get_event(li); - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_KEYBOARD_KEY); kbdevent = libinput_event_get_keyboard_event(event); litest_assert_int_eq(libinput_event_keyboard_get_key(kbdevent), (unsigned int)KEY_A); - litest_assert_int_eq(libinput_event_keyboard_get_key_state(kbdevent), + litest_assert_enum_eq(libinput_event_keyboard_get_key_state(kbdevent), LIBINPUT_KEY_STATE_RELEASED); libinput_event_destroy(event); @@ -581,7 +581,7 @@ START_TEST(device_disable_release_tap) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* tap happened before suspending, so we still expect the event */ litest_timeout_tap(); @@ -598,7 +598,7 @@ START_TEST(device_disable_release_tap) /* resume, make sure we don't get anything */ status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_dispatch(li); litest_assert_empty_queue(li); @@ -628,7 +628,7 @@ START_TEST(device_disable_release_tap_n_drag) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_dispatch(li); litest_touch_up(dev, 0); @@ -665,7 +665,7 @@ START_TEST(device_disable_release_softbutton) /* disable */ status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_button_event(li, BTN_RIGHT, @@ -681,7 +681,7 @@ START_TEST(device_disable_release_softbutton) /* resume, make sure we don't get anything */ status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_dispatch(li); litest_assert_empty_queue(li); @@ -705,7 +705,7 @@ START_TEST(device_disable_topsoftbutton) status = libinput_device_config_send_events_set_mode(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); litest_touch_down(dev, 0, 90, 10); @@ -715,26 +715,26 @@ START_TEST(device_disable_topsoftbutton) litest_wait_for_event(li); event = libinput_get_event(li); - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_POINTER_BUTTON); litest_assert_ptr_eq(libinput_event_get_device(event), trackpoint->libinput_device); ptrevent = libinput_event_get_pointer_event(event); litest_assert_int_eq(libinput_event_pointer_get_button(ptrevent), (unsigned int)BTN_RIGHT); - litest_assert_int_eq(libinput_event_pointer_get_button_state(ptrevent), + litest_assert_enum_eq(libinput_event_pointer_get_button_state(ptrevent), LIBINPUT_BUTTON_STATE_PRESSED); libinput_event_destroy(event); event = libinput_get_event(li); - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_POINTER_BUTTON); litest_assert_ptr_eq(libinput_event_get_device(event), trackpoint->libinput_device); ptrevent = libinput_event_get_pointer_event(event); litest_assert_int_eq(libinput_event_pointer_get_button(ptrevent), (unsigned int)BTN_RIGHT); - litest_assert_int_eq(libinput_event_pointer_get_button_state(ptrevent), + litest_assert_enum_eq(libinput_event_pointer_get_button_state(ptrevent), LIBINPUT_BUTTON_STATE_RELEASED); libinput_event_destroy(event); diff --git a/test/test-gestures.c b/test/test-gestures.c index 99864840..0ecefc81 100644 --- a/test/test-gestures.c +++ b/test/test-gestures.c @@ -1415,9 +1415,9 @@ START_TEST(gestures_hold_config_default_disabled) litest_assert_int_eq(libinput_device_config_gesture_hold_is_available(device), 0); - litest_assert_int_eq(libinput_device_config_gesture_get_hold_default_enabled(device), + litest_assert_enum_eq(libinput_device_config_gesture_get_hold_default_enabled(device), LIBINPUT_CONFIG_HOLD_DISABLED); - litest_assert_int_eq(libinput_device_config_gesture_get_hold_default_enabled(device), + litest_assert_enum_eq(libinput_device_config_gesture_get_hold_default_enabled(device), LIBINPUT_CONFIG_HOLD_DISABLED); } END_TEST @@ -1429,9 +1429,9 @@ START_TEST(gestures_hold_config_default_enabled) litest_assert_int_eq(libinput_device_config_gesture_hold_is_available(device), 1); - litest_assert_int_eq(libinput_device_config_gesture_get_hold_default_enabled(device), + litest_assert_enum_eq(libinput_device_config_gesture_get_hold_default_enabled(device), LIBINPUT_CONFIG_HOLD_ENABLED); - litest_assert_int_eq(libinput_device_config_gesture_get_hold_enabled(device), + litest_assert_enum_eq(libinput_device_config_gesture_get_hold_enabled(device), LIBINPUT_CONFIG_HOLD_ENABLED); } END_TEST @@ -1441,9 +1441,9 @@ START_TEST(gestures_hold_config_set_invalid) struct litest_device *dev = litest_current_device(); struct libinput_device *device = dev->libinput_device; - litest_assert_int_eq(libinput_device_config_gesture_set_hold_enabled(device, -1), + litest_assert_enum_eq(libinput_device_config_gesture_set_hold_enabled(device, -1), LIBINPUT_CONFIG_STATUS_INVALID); - litest_assert_int_eq(libinput_device_config_gesture_set_hold_enabled(device, 2), + litest_assert_enum_eq(libinput_device_config_gesture_set_hold_enabled(device, 2), LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -1455,11 +1455,11 @@ START_TEST(gestures_hold_config_is_available) litest_assert_int_eq(libinput_device_config_gesture_hold_is_available(device), 1); - litest_assert_int_eq(libinput_device_config_gesture_get_hold_enabled(device), + litest_assert_enum_eq(libinput_device_config_gesture_get_hold_enabled(device), LIBINPUT_CONFIG_HOLD_ENABLED); - litest_assert_int_eq(libinput_device_config_gesture_set_hold_enabled(device, LIBINPUT_CONFIG_HOLD_DISABLED), + litest_assert_enum_eq(libinput_device_config_gesture_set_hold_enabled(device, LIBINPUT_CONFIG_HOLD_DISABLED), LIBINPUT_CONFIG_STATUS_SUCCESS); - litest_assert_int_eq(libinput_device_config_gesture_get_hold_enabled(device), + litest_assert_enum_eq(libinput_device_config_gesture_get_hold_enabled(device), LIBINPUT_CONFIG_HOLD_DISABLED); } END_TEST @@ -1471,11 +1471,11 @@ START_TEST(gestures_hold_config_is_not_available) litest_assert_int_eq(libinput_device_config_gesture_hold_is_available(device), 0); - litest_assert_int_eq(libinput_device_config_gesture_get_hold_enabled(device), + litest_assert_enum_eq(libinput_device_config_gesture_get_hold_enabled(device), LIBINPUT_CONFIG_HOLD_DISABLED); - litest_assert_int_eq(libinput_device_config_gesture_set_hold_enabled(device, LIBINPUT_CONFIG_HOLD_ENABLED), + litest_assert_enum_eq(libinput_device_config_gesture_set_hold_enabled(device, LIBINPUT_CONFIG_HOLD_ENABLED), LIBINPUT_CONFIG_STATUS_UNSUPPORTED); - litest_assert_int_eq(libinput_device_config_gesture_set_hold_enabled(device, LIBINPUT_CONFIG_HOLD_DISABLED), + litest_assert_enum_eq(libinput_device_config_gesture_set_hold_enabled(device, LIBINPUT_CONFIG_HOLD_DISABLED), LIBINPUT_CONFIG_STATUS_SUCCESS); } END_TEST diff --git a/test/test-keyboard.c b/test/test-keyboard.c index 770a1e84..537e0c96 100644 --- a/test/test-keyboard.c +++ b/test/test-keyboard.c @@ -81,7 +81,7 @@ START_TEST(keyboard_seat_key_count) litest_assert_notnull(kev); litest_assert_int_eq(libinput_event_keyboard_get_key(kev), (unsigned int)KEY_A); - litest_assert_int_eq(libinput_event_keyboard_get_key_state(kev), + litest_assert_enum_eq(libinput_event_keyboard_get_key_state(kev), LIBINPUT_KEY_STATE_RELEASED); --expected_key_button_count; @@ -236,8 +236,8 @@ START_TEST(keyboard_key_auto_release) litest_assert_event_type(event, LIBINPUT_EVENT_KEYBOARD_KEY); kevent = libinput_event_get_keyboard_event(event); - litest_assert_int_eq(libinput_event_keyboard_get_key_state(kevent), - LIBINPUT_KEY_STATE_RELEASED); + litest_assert_enum_eq(libinput_event_keyboard_get_key_state(kevent), + LIBINPUT_KEY_STATE_RELEASED); key = libinput_event_keyboard_get_key(kevent); valid_code = 0; @@ -466,22 +466,22 @@ START_TEST(keyboard_no_scroll) enum libinput_config_status status; method = libinput_device_config_scroll_get_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); method = libinput_device_config_scroll_get_default_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_2FG); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_EDGE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); } END_TEST diff --git a/test/test-log.c b/test/test-log.c index 2d759297..e1ec235e 100644 --- a/test/test-log.c +++ b/test/test-log.c @@ -72,7 +72,7 @@ START_TEST(log_default_priority) li = libinput_path_create_context(&simple_interface, NULL); pri = libinput_log_get_priority(li); - litest_assert_int_eq(pri, LIBINPUT_LOG_PRIORITY_ERROR); + litest_assert_enum_eq(pri, LIBINPUT_LOG_PRIORITY_ERROR); libinput_unref(li); } diff --git a/test/test-pad.c b/test/test-pad.c index 726d2390..4f2f8c4e 100644 --- a/test/test-pad.c +++ b/test/test-pad.c @@ -674,7 +674,7 @@ START_TEST(pad_left_handed_default) 0); status = libinput_device_config_left_handed_set(dev->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_int_eq(libinput_device_config_left_handed_get(device), 1); @@ -682,7 +682,7 @@ START_TEST(pad_left_handed_default) 0); status = libinput_device_config_left_handed_set(dev->libinput_device, 0); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_int_eq(libinput_device_config_left_handed_get(device), 0); @@ -713,7 +713,7 @@ START_TEST(pad_no_left_handed) #if HAVE_LIBWACOM status = libinput_device_config_left_handed_set(dev->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); litest_assert_int_eq(libinput_device_config_left_handed_get(device), 0); @@ -721,7 +721,7 @@ START_TEST(pad_no_left_handed) 0); status = libinput_device_config_left_handed_set(dev->libinput_device, 0); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); litest_assert_int_eq(libinput_device_config_left_handed_get(device), 0); diff --git a/test/test-pointer.c b/test/test-pointer.c index 2673e034..60572338 100644 --- a/test/test-pointer.c +++ b/test/test-pointer.c @@ -296,9 +296,9 @@ START_TEST(pointer_absolute_initial_state) ev1 = libinput_get_event(libinput1); ev2 = libinput_get_event(libinput2); - litest_assert_int_eq(libinput_event_get_type(ev1), + litest_assert_enum_eq(libinput_event_get_type(ev1), LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE); - litest_assert_int_eq(libinput_event_get_type(ev1), + litest_assert_enum_eq(libinput_event_get_type(ev1), libinput_event_get_type(ev2)); p1 = libinput_event_get_pointer_event(ev1); @@ -470,7 +470,7 @@ START_TEST(pointer_button_auto_release) litest_assert_event_type(event, LIBINPUT_EVENT_POINTER_BUTTON); pevent = libinput_event_get_pointer_event(event); - litest_assert_int_eq(libinput_event_pointer_get_button_state(pevent), + litest_assert_enum_eq(libinput_event_pointer_get_button_state(pevent), LIBINPUT_BUTTON_STATE_RELEASED); button = libinput_event_pointer_get_button(pevent); @@ -997,11 +997,11 @@ START_TEST(pointer_scroll_natural_enable_config) enum libinput_config_status status; status = libinput_device_config_scroll_set_natural_scroll_enabled(dev->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_int_eq(libinput_device_config_scroll_get_natural_scroll_enabled(dev->libinput_device), 1); status = libinput_device_config_scroll_set_natural_scroll_enabled(dev->libinput_device, 0); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_int_eq(libinput_device_config_scroll_get_natural_scroll_enabled(dev->libinput_device), 0); } END_TEST @@ -1139,7 +1139,7 @@ START_TEST(pointer_seat_button_count) litest_assert_notnull(tev); litest_assert_int_eq(libinput_event_pointer_get_button(tev), (unsigned int)BTN_LEFT); - litest_assert_int_eq(libinput_event_pointer_get_button_state(tev), + litest_assert_enum_eq(libinput_event_pointer_get_button_state(tev), LIBINPUT_BUTTON_STATE_PRESSED); ++expected_seat_button_count; @@ -1172,7 +1172,7 @@ START_TEST(pointer_seat_button_count) litest_assert_notnull(tev); litest_assert_int_eq(libinput_event_pointer_get_button(tev), (unsigned int)BTN_LEFT); - litest_assert_int_eq(libinput_event_pointer_get_button_state(tev), + litest_assert_enum_eq(libinput_event_pointer_get_button_state(tev), LIBINPUT_BUTTON_STATE_RELEASED); --expected_seat_button_count; @@ -1210,7 +1210,7 @@ START_TEST(pointer_no_calibration) status = libinput_device_config_calibration_set_matrix(d, calibration); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST @@ -1243,7 +1243,7 @@ START_TEST(pointer_left_handed) enum libinput_config_status status; status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); litest_button_click_debounced(dev, li, BTN_LEFT, 1); @@ -1291,7 +1291,7 @@ START_TEST(pointer_left_handed_during_click) /* Change while button is down, expect correct release event */ status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_button_click_debounced(dev, li, BTN_LEFT, 0); @@ -1321,7 +1321,7 @@ START_TEST(pointer_left_handed_during_click_multiple_buttons) litest_dispatch(li); status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* No left-handed until all buttons were down */ litest_button_click_debounced(dev, li, BTN_RIGHT, 1); @@ -1350,7 +1350,7 @@ START_TEST(pointer_left_handed_disable_with_button_down) enum libinput_config_status status; status = libinput_device_config_left_handed_set(dev->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); litest_button_click_debounced(dev, li, BTN_LEFT, 1); @@ -1446,9 +1446,9 @@ START_TEST(pointer_scroll_button_noscroll) status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_scroll_set_button(device, BTN_LEFT); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST @@ -1509,9 +1509,9 @@ START_TEST(pointer_scroll_button_middle_emulation) status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_scroll_set_button(device, BTN_MIDDLE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -1583,14 +1583,14 @@ litest_enable_scroll_button_lock(struct litest_device *dev, status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_scroll_set_button(device, button); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_scroll_set_button_lock(device, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); } START_TEST(pointer_scroll_button_lock) @@ -1646,9 +1646,9 @@ START_TEST(pointer_scroll_button_lock_defaults) enum libinput_config_scroll_button_lock_state state; state = libinput_device_config_scroll_get_button_lock(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); state = libinput_device_config_scroll_get_default_button_lock(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); } END_TEST @@ -1659,26 +1659,26 @@ START_TEST(pointer_scroll_button_lock_config) enum libinput_config_scroll_button_lock_state state; state = libinput_device_config_scroll_get_button_lock(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); state = libinput_device_config_scroll_get_default_button_lock(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); status = libinput_device_config_scroll_set_button_lock(dev->libinput_device, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); state = libinput_device_config_scroll_get_button_lock(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED); status = libinput_device_config_scroll_set_button_lock(dev->libinput_device, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); state = libinput_device_config_scroll_get_button_lock(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED); status = libinput_device_config_scroll_set_button_lock(dev->libinput_device, LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED + 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -2126,9 +2126,9 @@ START_TEST(pointer_scroll_defaults_logitech_marble) uint32_t button; method = libinput_device_config_scroll_get_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); method = libinput_device_config_scroll_get_default_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_SCROLL_NO_SCROLL); button = libinput_device_config_scroll_get_button(device); litest_assert_int_eq(button, (unsigned int)BTN_SIDE); @@ -2151,7 +2151,7 @@ START_TEST(pointer_accel_defaults) for (speed = -2.0; speed < -1.0; speed += 0.2) { status = libinput_device_config_accel_set_speed(device, speed); - litest_assert_int_eq(status, + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); litest_assert_double_eq(libinput_device_config_accel_get_speed(device), 0.0); @@ -2160,7 +2160,7 @@ START_TEST(pointer_accel_defaults) for (speed = -1.0; speed <= 1.0; speed += 0.2) { status = libinput_device_config_accel_set_speed(device, speed); - litest_assert_int_eq(status, + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_double_eq(libinput_device_config_accel_get_speed(device), speed); @@ -2169,7 +2169,7 @@ START_TEST(pointer_accel_defaults) for (speed = 1.2; speed <= 2.0; speed += 0.2) { status = libinput_device_config_accel_set_speed(device, speed); - litest_assert_int_eq(status, + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); litest_assert_double_eq(libinput_device_config_accel_get_speed(device), 1.0); @@ -2188,10 +2188,10 @@ START_TEST(pointer_accel_invalid) status = libinput_device_config_accel_set_speed(device, NAN); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); status = libinput_device_config_accel_set_speed(device, INFINITY); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -2212,10 +2212,10 @@ START_TEST(pointer_accel_defaults_absolute) status = libinput_device_config_accel_set_speed(device, speed); if (speed >= -1.0 && speed <= 1.0) - litest_assert_int_eq(status, + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); else - litest_assert_int_eq(status, + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); litest_assert_double_eq(libinput_device_config_accel_get_speed(device), 0.0); @@ -2283,10 +2283,10 @@ START_TEST(pointer_accel_profile_defaults) litest_assert(libinput_device_config_accel_is_available(device)); profile = libinput_device_config_accel_get_default_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); profiles = libinput_device_config_accel_get_profiles(device); litest_assert(profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); @@ -2295,24 +2295,24 @@ START_TEST(pointer_accel_profile_defaults) status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT); profile = libinput_device_config_accel_get_default_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM); } END_TEST @@ -2330,14 +2330,14 @@ START_TEST(pointer_accel_config_reset_to_defaults) }; ARRAY_FOR_EACH(profiles, profile) { - litest_assert_int_eq(libinput_device_config_accel_set_speed(device, 1.0), + litest_assert_enum_eq(libinput_device_config_accel_set_speed(device, 1.0), LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_double_eq(libinput_device_config_accel_get_speed(device), 1.0); struct libinput_config_accel *config = libinput_config_accel_create(LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); - litest_assert_int_eq(libinput_device_config_accel_apply(device, config), + litest_assert_enum_eq(libinput_device_config_accel_apply(device, config), LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_double_eq(libinput_device_config_accel_get_speed(device), default_speed); @@ -2394,14 +2394,14 @@ START_TEST(pointer_accel_config) litest_assert_int_eq(status, t->expected_status); status = libinput_device_config_accel_apply(device, config_custom_changed); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM); status = libinput_device_config_accel_apply(device, config_custom_default); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM); } } @@ -2420,19 +2420,19 @@ START_TEST(pointer_accel_profile_invalid) status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE + 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE |LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM |LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -2446,22 +2446,22 @@ START_TEST(pointer_accel_profile_noaccel) litest_assert(!libinput_device_config_accel_is_available(device)); profile = libinput_device_config_accel_get_default_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE + 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE |LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -2814,22 +2814,22 @@ START_TEST(middlebutton_default_enabled) litest_assert(available); state = libinput_device_config_middle_emulation_get_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); state = libinput_device_config_middle_emulation_get_default_enabled( device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); status = libinput_device_config_middle_emulation_set_enabled(device, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_middle_emulation_set_enabled(device, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_middle_emulation_set_enabled(device, 3); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -2845,21 +2845,21 @@ START_TEST(middlebutton_default_clickpad) litest_assert(available); state = libinput_device_config_middle_emulation_get_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); state = libinput_device_config_middle_emulation_get_default_enabled( device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); status = libinput_device_config_middle_emulation_set_enabled(device, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_middle_emulation_set_enabled(device, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_middle_emulation_set_enabled(device, 3); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -2883,10 +2883,10 @@ START_TEST(middlebutton_default_touchpad) state = libinput_device_config_middle_emulation_get_enabled( device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); state = libinput_device_config_middle_emulation_get_default_enabled( device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); } END_TEST @@ -2902,10 +2902,10 @@ START_TEST(middlebutton_default_alps) state = libinput_device_config_middle_emulation_get_enabled( device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); state = libinput_device_config_middle_emulation_get_default_enabled( device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); } END_TEST @@ -2920,16 +2920,16 @@ START_TEST(middlebutton_default_disabled) available = libinput_device_config_middle_emulation_is_available(device); litest_assert(!available); state = libinput_device_config_middle_emulation_get_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); state = libinput_device_config_middle_emulation_get_default_enabled( device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); status = libinput_device_config_middle_emulation_set_enabled(device, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_middle_emulation_set_enabled(device, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST diff --git a/test/test-switch.c b/test/test-switch.c index db0dd82c..25479678 100644 --- a/test/test-switch.c +++ b/test/test-switch.c @@ -215,8 +215,8 @@ START_TEST(switch_down_on_init) libinput_event_destroy(event); while ((event = libinput_get_event(li))) { - litest_assert_int_ne(libinput_event_get_type(event), - LIBINPUT_EVENT_SWITCH_TOGGLE); + litest_assert_enum_ne(libinput_event_get_type(event), + LIBINPUT_EVENT_SWITCH_TOGGLE); libinput_event_destroy(event); } @@ -255,8 +255,8 @@ START_TEST(switch_not_down_on_init) litest_dispatch(li); while ((event = libinput_get_event(li)) != NULL) { - litest_assert_int_ne(libinput_event_get_type(event), - LIBINPUT_EVENT_SWITCH_TOGGLE); + litest_assert_enum_ne(libinput_event_get_type(event), + LIBINPUT_EVENT_SWITCH_TOGGLE); libinput_event_destroy(event); } @@ -806,8 +806,8 @@ START_TEST(lid_update_hw_on_key_closed_on_init) /* don't expect a switch waiting for us, this is run for an * unreliable device */ while (libinput_next_event_type(li) != LIBINPUT_EVENT_NONE) { - litest_assert_int_ne(libinput_next_event_type(li), - LIBINPUT_EVENT_SWITCH_TOGGLE); + litest_assert_enum_ne(libinput_next_event_type(li), + LIBINPUT_EVENT_SWITCH_TOGGLE); libinput_event_destroy(libinput_get_event(li)); } diff --git a/test/test-tablet.c b/test/test-tablet.c index f66a6683..b22b32d8 100644 --- a/test/test-tablet.c +++ b/test/test-tablet.c @@ -82,7 +82,7 @@ START_TEST(button_down_up) tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tev), button); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tev), LIBINPUT_BUTTON_STATE_PRESSED); libinput_event_destroy(event); litest_assert_empty_queue(li); @@ -94,7 +94,7 @@ START_TEST(button_down_up) tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tev), button); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tev), LIBINPUT_BUTTON_STATE_RELEASED); libinput_event_destroy(event); litest_assert_empty_queue(li); @@ -137,7 +137,7 @@ START_TEST(button_seat_count) event = libinput_get_event(li); tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tev), button); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tev), LIBINPUT_BUTTON_STATE_PRESSED); litest_assert_int_eq(libinput_event_tablet_tool_get_seat_button_count(tev), 1U); libinput_event_destroy(event); @@ -145,7 +145,7 @@ START_TEST(button_seat_count) event = libinput_get_event(li); tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tev), button); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tev), LIBINPUT_BUTTON_STATE_PRESSED); litest_assert_int_eq(libinput_event_tablet_tool_get_seat_button_count(tev), 2U); libinput_event_destroy(event); @@ -158,7 +158,7 @@ START_TEST(button_seat_count) event = libinput_get_event(li); tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tev), LIBINPUT_BUTTON_STATE_RELEASED); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tev), button); litest_assert_int_eq(libinput_event_tablet_tool_get_seat_button_count(tev), 1U); @@ -166,7 +166,7 @@ START_TEST(button_seat_count) event = libinput_get_event(li); tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tev), LIBINPUT_BUTTON_STATE_RELEASED); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tev), button); litest_assert_int_eq(libinput_event_tablet_tool_get_seat_button_count(tev), 0U); @@ -241,7 +241,7 @@ START_TEST(tip_down_up) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); litest_assert_empty_queue(li); @@ -254,7 +254,7 @@ START_TEST(tip_down_up) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -293,10 +293,10 @@ START_TEST(tip_down_up_eraser) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_DOWN); tool = libinput_event_tablet_tool_get_tool(tablet_event); - litest_assert_int_eq(libinput_tablet_tool_get_type(tool), LIBINPUT_TABLET_TOOL_TYPE_ERASER); + litest_assert_enum_eq(libinput_tablet_tool_get_type(tool), LIBINPUT_TABLET_TOOL_TYPE_ERASER); libinput_event_destroy(event); litest_assert_empty_queue(li); @@ -308,10 +308,10 @@ START_TEST(tip_down_up_eraser) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); tool = libinput_event_tablet_tool_get_tool(tablet_event); - litest_assert_int_eq(libinput_tablet_tool_get_type(tool), LIBINPUT_TABLET_TOOL_TYPE_ERASER); + litest_assert_enum_eq(libinput_tablet_tool_get_type(tool), LIBINPUT_TABLET_TOOL_TYPE_ERASER); libinput_event_destroy(event); litest_assert_empty_queue(li); @@ -342,14 +342,14 @@ START_TEST(tip_down_prox_in) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(tablet_event), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN); libinput_event_destroy(event); event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); @@ -385,7 +385,7 @@ START_TEST(tip_up_prox_out) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -394,7 +394,7 @@ START_TEST(tip_up_prox_out) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(tablet_event), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT); libinput_event_destroy(event); @@ -431,7 +431,7 @@ START_TEST(tip_up_btn_change) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -440,7 +440,7 @@ START_TEST(tip_up_btn_change) LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tablet_event), (unsigned int)BTN_STYLUS); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tablet_event), LIBINPUT_BUTTON_STATE_PRESSED); libinput_event_destroy(event); @@ -464,7 +464,7 @@ START_TEST(tip_up_btn_change) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -473,7 +473,7 @@ START_TEST(tip_up_btn_change) LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tablet_event), (unsigned int)BTN_STYLUS); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tablet_event), LIBINPUT_BUTTON_STATE_RELEASED); libinput_event_destroy(event); @@ -508,7 +508,7 @@ START_TEST(tip_down_btn_change) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); @@ -518,7 +518,7 @@ START_TEST(tip_down_btn_change) LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tablet_event), (unsigned int)BTN_STYLUS); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tablet_event), LIBINPUT_BUTTON_STATE_PRESSED); libinput_event_destroy(event); @@ -542,7 +542,7 @@ START_TEST(tip_down_btn_change) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); @@ -552,7 +552,7 @@ START_TEST(tip_down_btn_change) LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(tablet_event), (unsigned int)BTN_STYLUS); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(tablet_event), LIBINPUT_BUTTON_STATE_RELEASED); libinput_event_destroy(event); @@ -593,7 +593,7 @@ START_TEST(tip_down_motion) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_DOWN); litest_assert(libinput_event_tablet_tool_x_has_changed(tablet_event)); litest_assert(libinput_event_tablet_tool_y_has_changed(tablet_event)); @@ -642,7 +642,7 @@ START_TEST(tip_up_motion) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); litest_assert(libinput_event_tablet_tool_x_has_changed(tablet_event)); litest_assert(libinput_event_tablet_tool_y_has_changed(tablet_event)); @@ -728,7 +728,7 @@ START_TEST(tip_up_motion_one_axis) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); x = libinput_event_tablet_tool_get_x(tablet_event); y = libinput_event_tablet_tool_get_y(tablet_event); @@ -774,7 +774,7 @@ START_TEST(tip_state_proximity) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -797,7 +797,7 @@ START_TEST(tip_state_proximity) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); } @@ -824,7 +824,7 @@ START_TEST(tip_state_axis) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_AXIS); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -839,7 +839,7 @@ START_TEST(tip_state_axis) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_AXIS); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); @@ -854,7 +854,7 @@ START_TEST(tip_state_axis) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_AXIS); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -884,7 +884,7 @@ START_TEST(tip_state_button) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -899,7 +899,7 @@ START_TEST(tip_state_button) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); @@ -914,7 +914,7 @@ START_TEST(tip_state_button) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -924,7 +924,7 @@ START_TEST(tip_state_button) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -958,7 +958,7 @@ START_TEST(tip_up_on_delete) event = libinput_get_event(li); tablet_event = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(tablet_event), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); @@ -1005,7 +1005,7 @@ START_TEST(proximity_in_out) have_tool_update = true; tablet_event = libinput_event_get_tablet_tool_event(event); tool = libinput_event_tablet_tool_get_tool(tablet_event); - litest_assert_int_eq(libinput_tablet_tool_get_type(tool), type); + litest_assert_enum_eq(libinput_tablet_tool_get_type(tool), type); } libinput_event_destroy(event); } @@ -1980,7 +1980,7 @@ START_TEST(left_handed_tilt) double tx, ty; status = libinput_device_config_left_handed_set(dev->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -2057,7 +2057,7 @@ START_TEST(left_handed_mouse_rotation) }; status = libinput_device_config_left_handed_set(dev->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -2108,7 +2108,7 @@ START_TEST(left_handed_artpen_rotation) return; status = libinput_device_config_left_handed_set(dev->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -2189,7 +2189,7 @@ START_TEST(motion_event_state) libinput_event_destroy(event); litest_dispatch(li); - litest_assert_int_eq(libinput_next_event_type(li), + litest_assert_enum_eq(libinput_next_event_type(li), LIBINPUT_EVENT_TABLET_TOOL_AXIS); /* we expect all events up to the button event to go from @@ -2214,7 +2214,7 @@ START_TEST(motion_event_state) libinput_event_destroy(event); } - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_TABLET_TOOL_BUTTON); libinput_event_destroy(event); } @@ -3011,7 +3011,7 @@ START_TEST(tool_direct_switch_skip_tool_update) event = libinput_get_event(li); tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(tev), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT); litest_assert_ptr_eq(libinput_event_tablet_tool_get_tool(tev), tool); libinput_event_destroy(event); @@ -3019,7 +3019,7 @@ START_TEST(tool_direct_switch_skip_tool_update) event = libinput_get_event(li); tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(tev), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN); litest_assert_ptr_ne(libinput_event_tablet_tool_get_tool(tev), tool); libinput_tablet_tool_unref(tool); @@ -3044,7 +3044,7 @@ START_TEST(tool_direct_switch_skip_tool_update) event = libinput_get_event(li); tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(tev), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT); litest_assert_ptr_eq(libinput_event_tablet_tool_get_tool(tev), tool); @@ -3059,7 +3059,7 @@ START_TEST(tool_direct_switch_skip_tool_update) event = libinput_get_event(li); tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(tev), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(tev), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN); litest_assert_ptr_eq(libinput_event_tablet_tool_get_tool(tev), tool); @@ -3242,7 +3242,7 @@ START_TEST(mouse_tool) LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); tool = libinput_event_tablet_tool_get_tool(tev); litest_assert_notnull(tool); - litest_assert_int_eq(libinput_tablet_tool_get_type(tool), + litest_assert_enum_eq(libinput_tablet_tool_get_type(tool), LIBINPUT_TABLET_TOOL_TYPE_MOUSE); libinput_event_destroy(event); @@ -3457,7 +3457,7 @@ START_TEST(airbrush_tool) tool = libinput_event_tablet_tool_get_tool(tev); litest_assert_notnull(tool); - litest_assert_int_eq(libinput_tablet_tool_get_type(tool), + litest_assert_enum_eq(libinput_tablet_tool_get_type(tool), LIBINPUT_TABLET_TOOL_TYPE_AIRBRUSH); litest_assert(libinput_tablet_tool_has_slider(tool)); @@ -3541,7 +3541,7 @@ START_TEST(artpen_tool) LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); tool = libinput_event_tablet_tool_get_tool(tev); litest_assert_notnull(tool); - litest_assert_int_eq(libinput_tablet_tool_get_type(tool), + litest_assert_enum_eq(libinput_tablet_tool_get_type(tool), LIBINPUT_TABLET_TOOL_TYPE_PEN); litest_assert(libinput_tablet_tool_has_rotation(tool)); @@ -3725,9 +3725,9 @@ START_TEST(tablet_calibration_has_matrix) status = libinput_device_config_calibration_set_matrix(d, calibration); if (has_calibration) - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); else - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST @@ -3780,7 +3780,7 @@ START_TEST(tablet_calibration_set_matrix_delta) status = libinput_device_config_calibration_set_matrix(d, calibration); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_tablet_proximity_in(dev, 100, 100, axes); litest_dispatch(li); @@ -3837,7 +3837,7 @@ START_TEST(tablet_calibration_set_matrix) status = libinput_device_config_calibration_set_matrix(d, calibration); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_tablet_proximity_in(dev, 100, 100, axes); litest_dispatch(li); @@ -3864,7 +3864,7 @@ START_TEST(tablet_calibration_set_matrix) calibration[4] = 0.5; status = libinput_device_config_calibration_set_matrix(d, calibration); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_tablet_proximity_in(dev, 100, 100, axes); litest_dispatch(li); @@ -4201,17 +4201,17 @@ START_TEST(tablet_pressure_config) litest_assert_double_eq(libinput_tablet_tool_config_pressure_range_get_default_minimum(tool), 0.0); litest_assert_double_eq(libinput_tablet_tool_config_pressure_range_get_default_maximum(tool), 1.0); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 1.0), + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 1.0), LIBINPUT_CONFIG_STATUS_SUCCESS); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.2, 0.5), + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.2, 0.5), LIBINPUT_CONFIG_STATUS_SUCCESS); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, -0.1, 1.0), + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, -0.1, 1.0), LIBINPUT_CONFIG_STATUS_INVALID); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 0.0), + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 0.0), LIBINPUT_CONFIG_STATUS_INVALID); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, 1.0, 1.0), + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, 1.0, 1.0), LIBINPUT_CONFIG_STATUS_INVALID); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 1.1), + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 1.1), LIBINPUT_CONFIG_STATUS_INVALID); /* The last successful one */ @@ -4253,7 +4253,7 @@ START_TEST(tablet_pressure_config_set_minimum) old_pressure = p; litest_assert(libinput_tablet_tool_config_pressure_range_is_available(tool)); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.4, 1.0), + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.4, 1.0), LIBINPUT_CONFIG_STATUS_SUCCESS); libinput_event_destroy(event); @@ -4341,8 +4341,8 @@ START_TEST(tablet_pressure_config_set_maximum) old_pressure = p; litest_assert(libinput_tablet_tool_config_pressure_range_is_available(tool)); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 0.6), - LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.0, 0.6), + LIBINPUT_CONFIG_STATUS_SUCCESS); libinput_event_destroy(event); /* config doesn't take effect until we're out of prox */ @@ -4438,7 +4438,7 @@ START_TEST(tablet_pressure_config_set_range) old_pressure = p; litest_assert(libinput_tablet_tool_config_pressure_range_is_available(tool)); - litest_assert_int_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.4, 0.6), + litest_assert_enum_eq(libinput_tablet_tool_config_pressure_range_set(tool, 0.4, 0.6), LIBINPUT_CONFIG_STATUS_SUCCESS); libinput_event_destroy(event); @@ -4911,26 +4911,26 @@ START_TEST(relative_no_profile) litest_assert(libinput_device_config_accel_is_available(device)); profile = libinput_device_config_accel_get_default_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); profiles = libinput_device_config_accel_get_profiles(device); - litest_assert_int_eq(profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, 0); - litest_assert_int_eq(profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT, 0); + litest_assert_enum_eq(profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE, 0); + litest_assert_enum_eq(profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT, 0); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); status = libinput_device_config_accel_set_profile(device, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); profile = libinput_device_config_accel_get_profile(device); - litest_assert_int_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); + litest_assert_enum_eq(profile, LIBINPUT_CONFIG_ACCEL_PROFILE_NONE); } END_TEST @@ -5134,7 +5134,7 @@ START_TEST(relative_calibration) status = libinput_device_config_calibration_set_matrix( dev->libinput_device, calibration); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_tablet_proximity_in(dev, 10, 10, axes); litest_drain_events(li); @@ -5539,7 +5539,7 @@ START_TEST(touch_arbitration_suspend_touch_device) status = libinput_device_config_send_events_set_mode( dev->libinput_device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -5576,7 +5576,7 @@ START_TEST(touch_arbitration_suspend_touch_device) status = libinput_device_config_send_events_set_mode( dev->libinput_device, LIBINPUT_CONFIG_SEND_EVENTS_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(dev, 0, 30, 30); litest_touch_move_to(dev, 0, 30, 30, 80, 80, 10); diff --git a/test/test-totem.c b/test/test-totem.c index 127727de..7f7dc3b1 100644 --- a/test/test-totem.c +++ b/test/test-totem.c @@ -54,7 +54,7 @@ START_TEST(totem_type) LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); tool = libinput_event_tablet_tool_get_tool(t); - litest_assert_int_eq(libinput_tablet_tool_get_type(tool), + litest_assert_enum_eq(libinput_tablet_tool_get_type(tool), LIBINPUT_TABLET_TOOL_TYPE_TOTEM); libinput_event_destroy(event); } @@ -101,14 +101,14 @@ START_TEST(totem_proximity_in_out) event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(t), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN); libinput_event_destroy(event); event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(t), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); @@ -119,14 +119,14 @@ START_TEST(totem_proximity_in_out) event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(t), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(t), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT); libinput_event_destroy(event); } @@ -163,7 +163,7 @@ START_TEST(totem_proximity_in_on_init) event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(t), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN); x = libinput_event_tablet_tool_get_x(t); y = libinput_event_tablet_tool_get_y(t); @@ -178,7 +178,7 @@ START_TEST(totem_proximity_in_on_init) event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(t), LIBINPUT_TABLET_TOOL_TIP_DOWN); x = libinput_event_tablet_tool_get_x(t); y = libinput_event_tablet_tool_get_y(t); @@ -218,14 +218,14 @@ START_TEST(totem_proximity_out_on_suspend) event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(t), LIBINPUT_TABLET_TOOL_TIP_UP); libinput_event_destroy(event); event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(t), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_OUT); libinput_event_destroy(event); @@ -379,9 +379,9 @@ START_TEST(totem_button) t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(t), (unsigned int)BTN_0); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(t), LIBINPUT_BUTTON_STATE_PRESSED); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(t), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); @@ -392,9 +392,9 @@ START_TEST(totem_button) t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_BUTTON); litest_assert_int_eq(libinput_event_tablet_tool_get_button(t), (unsigned int)BTN_0); - litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_button_state(t), LIBINPUT_BUTTON_STATE_RELEASED); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(t), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); } @@ -424,7 +424,7 @@ START_TEST(totem_button_down_on_init) event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY); - litest_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_proximity_state(t), LIBINPUT_TABLET_TOOL_PROXIMITY_STATE_IN); libinput_event_destroy(event); @@ -432,7 +432,7 @@ START_TEST(totem_button_down_on_init) event = libinput_get_event(li); t = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_TIP); - litest_assert_int_eq(libinput_event_tablet_tool_get_tip_state(t), + litest_assert_enum_eq(libinput_event_tablet_tool_get_tip_state(t), LIBINPUT_TABLET_TOOL_TIP_DOWN); libinput_event_destroy(event); diff --git a/test/test-touch.c b/test/test-touch.c index 8e2270f5..7069fad1 100644 --- a/test/test-touch.c +++ b/test/test-touch.c @@ -248,7 +248,7 @@ START_TEST(touch_many_slots) litest_dispatch(libinput); do { type = libinput_event_get_type(ev); - litest_assert_int_ne(type, LIBINPUT_EVENT_TOUCH_DOWN); + litest_assert_enum_ne(type, LIBINPUT_EVENT_TOUCH_DOWN); if (type == LIBINPUT_EVENT_TOUCH_UP) slot_count--; @@ -521,12 +521,12 @@ START_TEST(touch_calibration_config) /* Twice so we have every to-fro combination */ for (int i = 0; i < 2; i++) { status = libinput_device_config_calibration_set_matrix(dev->libinput_device, identity); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); libinput_device_config_calibration_get_matrix(dev->libinput_device, matrix); litest_assert_int_eq(memcmp(matrix, identity, sizeof(matrix)), 0); status = libinput_device_config_calibration_set_matrix(dev->libinput_device, nonidentity); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); libinput_device_config_calibration_get_matrix(dev->libinput_device, matrix); litest_assert_int_eq(memcmp(matrix, nonidentity, sizeof(matrix)), 0); } @@ -628,7 +628,7 @@ START_TEST(touch_no_left_handed) litest_assert_int_eq(rc, 0); status = libinput_device_config_left_handed_set(d, 0); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST diff --git a/test/test-touchpad-buttons.c b/test/test-touchpad-buttons.c index aeae3f92..ed0e7bfa 100644 --- a/test/test-touchpad-buttons.c +++ b/test/test-touchpad-buttons.c @@ -69,16 +69,16 @@ START_TEST(touchpad_click_defaults_clickfinger) litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); method = libinput_device_config_click_get_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); method = libinput_device_config_click_get_default_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); status = libinput_device_config_click_set_method(device, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_click_set_method(device, LIBINPUT_CONFIG_CLICK_METHOD_NONE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); } END_TEST @@ -89,9 +89,9 @@ START_TEST(touchpad_click_default_clickfinger_map) enum libinput_config_clickfinger_button_map map; map = libinput_device_config_click_get_clickfinger_button_map(device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); map = libinput_device_config_click_get_default_clickfinger_button_map(device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); } END_TEST @@ -104,23 +104,23 @@ START_TEST(touchpad_click_set_clickfinger_map) map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM; status = libinput_device_config_click_set_clickfinger_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); map = libinput_device_config_click_get_clickfinger_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM); map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR; status = libinput_device_config_click_set_clickfinger_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); map = libinput_device_config_click_get_clickfinger_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR); map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM - 1; status = libinput_device_config_click_set_clickfinger_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR + 1; status = libinput_device_config_click_set_clickfinger_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -138,16 +138,16 @@ START_TEST(touchpad_click_defaults_btnarea) litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); method = libinput_device_config_click_get_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); method = libinput_device_config_click_get_default_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); status = libinput_device_config_click_set_method(device, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_click_set_method(device, LIBINPUT_CONFIG_CLICK_METHOD_NONE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); } END_TEST @@ -168,16 +168,16 @@ START_TEST(touchpad_click_defaults_none) litest_assert_int_eq(methods, 0U); method = libinput_device_config_click_get_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_NONE); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_NONE); method = libinput_device_config_click_get_default_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_NONE); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_NONE); status = libinput_device_config_click_set_method(device, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_click_set_method(device, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST @@ -973,14 +973,14 @@ START_TEST(touchpad_clickfinger_appletouch_config) litest_assert(methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); method = libinput_device_config_click_get_method(device); - litest_assert_int_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); + litest_assert_enum_eq(method, LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER); status = libinput_device_config_click_set_method(device, LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_click_set_method(device, LIBINPUT_CONFIG_CLICK_METHOD_NONE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); } END_TEST @@ -1988,14 +1988,14 @@ START_TEST(clickpad_middleemulation_config_delayed) /* actual config is delayed, but status is immediate */ status = libinput_device_config_middle_emulation_set_enabled(device, LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); enabled = libinput_device_config_middle_emulation_get_enabled(device); litest_assert(enabled); status = libinput_device_config_middle_emulation_set_enabled(device, LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); enabled = libinput_device_config_middle_emulation_get_enabled(device); litest_assert(!enabled); } diff --git a/test/test-touchpad-tap.c b/test/test-touchpad-tap.c index efdfba4b..d045729c 100644 --- a/test/test-touchpad-tap.c +++ b/test/test-touchpad-tap.c @@ -3679,12 +3679,12 @@ START_TEST(touchpad_tap_is_not_available) struct litest_device *dev = litest_current_device(); litest_assert_int_eq(libinput_device_config_tap_get_finger_count(dev->libinput_device), 0); - litest_assert_int_eq(libinput_device_config_tap_get_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_enabled(dev->libinput_device), LIBINPUT_CONFIG_TAP_DISABLED); - litest_assert_int_eq(libinput_device_config_tap_set_enabled(dev->libinput_device, + litest_assert_enum_eq(libinput_device_config_tap_set_enabled(dev->libinput_device, LIBINPUT_CONFIG_TAP_ENABLED), LIBINPUT_CONFIG_STATUS_UNSUPPORTED); - litest_assert_int_eq(libinput_device_config_tap_set_enabled(dev->libinput_device, + litest_assert_enum_eq(libinput_device_config_tap_set_enabled(dev->libinput_device, LIBINPUT_CONFIG_TAP_DISABLED), LIBINPUT_CONFIG_STATUS_SUCCESS); } @@ -3696,9 +3696,9 @@ START_TEST(touchpad_tap_default_disabled) /* this test is only run on specific devices */ - litest_assert_int_eq(libinput_device_config_tap_get_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_enabled(dev->libinput_device), LIBINPUT_CONFIG_TAP_DISABLED); - litest_assert_int_eq(libinput_device_config_tap_get_default_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_default_enabled(dev->libinput_device), LIBINPUT_CONFIG_TAP_DISABLED); } END_TEST @@ -3709,9 +3709,9 @@ START_TEST(touchpad_tap_default_enabled) /* this test is only run on specific devices */ - litest_assert_int_eq(libinput_device_config_tap_get_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_enabled(dev->libinput_device), LIBINPUT_CONFIG_TAP_ENABLED); - litest_assert_int_eq(libinput_device_config_tap_get_default_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_default_enabled(dev->libinput_device), LIBINPUT_CONFIG_TAP_ENABLED); } END_TEST @@ -3720,9 +3720,9 @@ START_TEST(touchpad_tap_invalid) { struct litest_device *dev = litest_current_device(); - litest_assert_int_eq(libinput_device_config_tap_set_enabled(dev->libinput_device, 2), + litest_assert_enum_eq(libinput_device_config_tap_set_enabled(dev->libinput_device, 2), LIBINPUT_CONFIG_STATUS_INVALID); - litest_assert_int_eq(libinput_device_config_tap_set_enabled(dev->libinput_device, -1), + litest_assert_enum_eq(libinput_device_config_tap_set_enabled(dev->libinput_device, -1), LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -3733,10 +3733,10 @@ START_TEST(touchpad_tap_default_map) enum libinput_config_tap_button_map map; map = libinput_device_config_tap_get_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); map = libinput_device_config_tap_get_default_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); } END_TEST @@ -3747,16 +3747,16 @@ START_TEST(touchpad_tap_map_unsupported) enum libinput_config_status status; map = libinput_device_config_tap_get_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); map = libinput_device_config_tap_get_default_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); status = libinput_device_config_tap_set_button_map(dev->libinput_device, LIBINPUT_CONFIG_TAP_MAP_LMR); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_tap_set_button_map(dev->libinput_device, LIBINPUT_CONFIG_TAP_MAP_LRM); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST @@ -3769,23 +3769,23 @@ START_TEST(touchpad_tap_set_map) map = LIBINPUT_CONFIG_TAP_MAP_LRM; status = libinput_device_config_tap_set_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); map = libinput_device_config_tap_get_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); map = LIBINPUT_CONFIG_TAP_MAP_LMR; status = libinput_device_config_tap_set_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); map = libinput_device_config_tap_get_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LMR); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LMR); map = LIBINPUT_CONFIG_TAP_MAP_LRM - 1; status = libinput_device_config_tap_set_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); map = LIBINPUT_CONFIG_TAP_MAP_LMR + 1; status = libinput_device_config_tap_set_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -3798,19 +3798,19 @@ START_TEST(touchpad_tap_set_map_no_tapping) map = LIBINPUT_CONFIG_TAP_MAP_LRM; status = libinput_device_config_tap_set_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); map = LIBINPUT_CONFIG_TAP_MAP_LMR; status = libinput_device_config_tap_set_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); map = LIBINPUT_CONFIG_TAP_MAP_LRM - 1; status = libinput_device_config_tap_set_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); map = LIBINPUT_CONFIG_TAP_MAP_LMR + 1; status = libinput_device_config_tap_set_button_map(device, map); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -3821,10 +3821,10 @@ START_TEST(touchpad_tap_get_map_no_tapping) enum libinput_config_tap_button_map map; map = libinput_device_config_tap_get_button_map(device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); map = libinput_device_config_tap_get_default_button_map(device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LRM); } END_TEST @@ -3847,7 +3847,7 @@ START_TEST(touchpad_tap_map_delayed) litest_set_tap_map(dev->libinput_device, LIBINPUT_CONFIG_TAP_MAP_LMR); map = libinput_device_config_tap_get_button_map(dev->libinput_device); - litest_assert_int_eq(map, LIBINPUT_CONFIG_TAP_MAP_LMR); + litest_assert_enum_eq(map, LIBINPUT_CONFIG_TAP_MAP_LMR); litest_touch_up(dev, 0); litest_touch_up(dev, 1); @@ -3871,9 +3871,9 @@ START_TEST(touchpad_drag_default_disabled) /* this test is only run on specific devices */ - litest_assert_int_eq(libinput_device_config_tap_get_default_drag_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_default_drag_enabled(dev->libinput_device), LIBINPUT_CONFIG_DRAG_DISABLED); - litest_assert_int_eq(libinput_device_config_tap_get_drag_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_drag_enabled(dev->libinput_device), LIBINPUT_CONFIG_DRAG_DISABLED); } END_TEST @@ -3884,9 +3884,9 @@ START_TEST(touchpad_drag_default_enabled) /* this test is only run on specific devices */ - litest_assert_int_eq(libinput_device_config_tap_get_default_drag_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_default_drag_enabled(dev->libinput_device), LIBINPUT_CONFIG_DRAG_ENABLED); - litest_assert_int_eq(libinput_device_config_tap_get_drag_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_drag_enabled(dev->libinput_device), LIBINPUT_CONFIG_DRAG_ENABLED); } END_TEST @@ -3895,9 +3895,9 @@ START_TEST(touchpad_drag_config_invalid) { struct litest_device *dev = litest_current_device(); - litest_assert_int_eq(libinput_device_config_tap_set_drag_enabled(dev->libinput_device, 2), + litest_assert_enum_eq(libinput_device_config_tap_set_drag_enabled(dev->libinput_device, 2), LIBINPUT_CONFIG_STATUS_INVALID); - litest_assert_int_eq(libinput_device_config_tap_set_drag_enabled(dev->libinput_device, -1), + litest_assert_enum_eq(libinput_device_config_tap_set_drag_enabled(dev->libinput_device, -1), LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -3907,16 +3907,16 @@ START_TEST(touchpad_drag_config_unsupported) struct litest_device *dev = litest_current_device(); enum libinput_config_status status; - litest_assert_int_eq(libinput_device_config_tap_get_default_drag_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_default_drag_enabled(dev->libinput_device), LIBINPUT_CONFIG_DRAG_DISABLED); - litest_assert_int_eq(libinput_device_config_tap_get_drag_enabled(dev->libinput_device), + litest_assert_enum_eq(libinput_device_config_tap_get_drag_enabled(dev->libinput_device), LIBINPUT_CONFIG_DRAG_DISABLED); status = libinput_device_config_tap_set_drag_enabled(dev->libinput_device, LIBINPUT_CONFIG_DRAG_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_tap_set_drag_enabled(dev->libinput_device, LIBINPUT_CONFIG_DRAG_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); } END_TEST @@ -3931,22 +3931,22 @@ START_TEST(touchpad_drag_config_enabledisable) litest_disable_tap_drag(dev->libinput_device); state = libinput_device_config_tap_get_drag_enabled(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DRAG_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DRAG_DISABLED); litest_enable_tap_drag(dev->libinput_device); state = libinput_device_config_tap_get_drag_enabled(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DRAG_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DRAG_ENABLED); /* same thing with tapping disabled */ litest_enable_tap(dev->libinput_device); litest_disable_tap_drag(dev->libinput_device); state = libinput_device_config_tap_get_drag_enabled(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DRAG_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DRAG_DISABLED); litest_enable_tap_drag(dev->libinput_device); state = libinput_device_config_tap_get_drag_enabled(dev->libinput_device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DRAG_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DRAG_ENABLED); } END_TEST @@ -4199,39 +4199,39 @@ START_TEST(touchpad_drag_lock_default_disabled) struct libinput_device *device = dev->libinput_device; enum libinput_config_status status; - litest_assert_int_eq(libinput_device_config_tap_get_drag_lock_enabled(device), + litest_assert_enum_eq(libinput_device_config_tap_get_drag_lock_enabled(device), LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); - litest_assert_int_eq(libinput_device_config_tap_get_default_drag_lock_enabled(device), + litest_assert_enum_eq(libinput_device_config_tap_get_default_drag_lock_enabled(device), LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); status = libinput_device_config_tap_set_drag_lock_enabled(device, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); /* ENABLED is a legacy spelling for ENABLED_TIMEOUT */ - litest_assert_int_eq(libinput_device_config_tap_get_drag_lock_enabled(device), + litest_assert_enum_eq(libinput_device_config_tap_get_drag_lock_enabled(device), LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_TIMEOUT); status = libinput_device_config_tap_set_drag_lock_enabled(device, LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); - litest_assert_int_eq(libinput_device_config_tap_get_drag_lock_enabled(device), + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(libinput_device_config_tap_get_drag_lock_enabled(device), LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); status = libinput_device_config_tap_set_drag_lock_enabled(device, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_TIMEOUT); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); - litest_assert_int_eq(libinput_device_config_tap_get_drag_lock_enabled(device), + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(libinput_device_config_tap_get_drag_lock_enabled(device), LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_TIMEOUT); status = libinput_device_config_tap_set_drag_lock_enabled(device, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); - litest_assert_int_eq(libinput_device_config_tap_get_drag_lock_enabled(device), + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(libinput_device_config_tap_get_drag_lock_enabled(device), LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY); status = libinput_device_config_tap_set_drag_lock_enabled(device, 3); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -4241,30 +4241,30 @@ START_TEST(touchpad_drag_lock_default_unavailable) struct libinput_device *device = dev->libinput_device; enum libinput_config_status status; - litest_assert_int_eq(libinput_device_config_tap_get_drag_lock_enabled(device), + litest_assert_enum_eq(libinput_device_config_tap_get_drag_lock_enabled(device), LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); - litest_assert_int_eq(libinput_device_config_tap_get_default_drag_lock_enabled(device), + litest_assert_enum_eq(libinput_device_config_tap_get_default_drag_lock_enabled(device), LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); status = libinput_device_config_tap_set_drag_lock_enabled(device, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_tap_set_drag_lock_enabled(device, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_TIMEOUT); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_tap_set_drag_lock_enabled(device, LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_tap_set_drag_lock_enabled(device, LIBINPUT_CONFIG_DRAG_LOCK_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_tap_set_drag_lock_enabled(device, 3); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST diff --git a/test/test-touchpad.c b/test/test-touchpad.c index 6573344f..5e0b0171 100644 --- a/test/test-touchpad.c +++ b/test/test-touchpad.c @@ -105,8 +105,8 @@ START_TEST(touchpad_2fg_no_motion) event = libinput_get_event(li); while (event) { - litest_assert_int_ne(libinput_event_get_type(event), - LIBINPUT_EVENT_POINTER_MOTION); + litest_assert_enum_ne(libinput_event_get_type(event), + LIBINPUT_EVENT_POINTER_MOTION); libinput_event_destroy(event); event = libinput_get_event(li); } @@ -615,11 +615,11 @@ START_TEST(touchpad_scroll_natural_enable_config) enum libinput_config_status status; status = libinput_device_config_scroll_set_natural_scroll_enabled(dev->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_int_eq(libinput_device_config_scroll_get_natural_scroll_enabled(dev->libinput_device), 1); status = libinput_device_config_scroll_set_natural_scroll_enabled(dev->libinput_device, 0); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_assert_int_eq(libinput_device_config_scroll_get_natural_scroll_enabled(dev->libinput_device), 0); } END_TEST @@ -872,14 +872,14 @@ START_TEST(touchpad_scroll_defaults) status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_EDGE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_scroll_set_method(device, LIBINPUT_CONFIG_SCROLL_2FG); if (should_have_2fg) - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); else - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } END_TEST @@ -1020,8 +1020,8 @@ START_TEST(touchpad_edge_scroll_source) LIBINPUT_EVENT_POINTER_SCROLL_FINGER, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL, LIBINPUT_POINTER_AXIS_SOURCE_FINGER); - litest_assert_int_eq(litest_event_pointer_get_axis_source(ptrev), - LIBINPUT_POINTER_AXIS_SOURCE_FINGER); + litest_assert_enum_eq(litest_event_pointer_get_axis_source(ptrev), + LIBINPUT_POINTER_AXIS_SOURCE_FINGER); libinput_event_destroy(event); } } @@ -2371,7 +2371,7 @@ START_TEST(touchpad_left_handed) return; status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); litest_button_click(dev, BTN_LEFT, 1); @@ -2416,7 +2416,7 @@ START_TEST(touchpad_left_handed_appletouch) litest_assert_int_eq(libinput_device_config_left_handed_is_available(d), 0); status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); litest_assert_int_eq(libinput_device_config_left_handed_get(d), 0); } END_TEST @@ -2432,7 +2432,7 @@ START_TEST(touchpad_left_handed_clickpad) return; status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); litest_touch_down(dev, 0, 10, 90); @@ -2486,7 +2486,7 @@ START_TEST(touchpad_left_handed_clickfinger) return; status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); litest_touch_down(dev, 0, 10, 90); @@ -2533,7 +2533,7 @@ START_TEST(touchpad_left_handed_tapping) litest_disable_hold_gestures(dev->libinput_device); status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -2568,7 +2568,7 @@ START_TEST(touchpad_left_handed_tapping_2fg) litest_disable_hold_gestures(dev->libinput_device); status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -2606,7 +2606,7 @@ START_TEST(touchpad_left_handed_delayed) litest_dispatch(li); status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_button_click(dev, BTN_LEFT, 0); @@ -2626,7 +2626,7 @@ START_TEST(touchpad_left_handed_delayed) litest_dispatch(li); status = libinput_device_config_left_handed_set(d, 0); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_button_click(dev, BTN_RIGHT, 0); litest_button_click(dev, BTN_LEFT, 0); @@ -2662,7 +2662,7 @@ START_TEST(touchpad_left_handed_clickpad_delayed) litest_dispatch(li); status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_button_click(dev, BTN_LEFT, 0); litest_touch_up(dev, 0); @@ -2681,7 +2681,7 @@ START_TEST(touchpad_left_handed_clickpad_delayed) litest_dispatch(li); status = libinput_device_config_left_handed_set(d, 0); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_button_click(dev, BTN_LEFT, 0); litest_touch_up(dev, 0); @@ -2717,7 +2717,7 @@ START_TEST(touchpad_left_handed_rotation) return; status = libinput_device_config_left_handed_set(d, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); @@ -3434,7 +3434,7 @@ START_TEST(touchpad_trackpoint_mb_click) status = libinput_device_config_scroll_set_method( trackpoint->libinput_device, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_drain_events(li); litest_button_click_debounced(touchpad, li, BTN_2, true); /* middle */ @@ -4692,19 +4692,19 @@ START_TEST(touchpad_dwt_config_default_on) litest_assert(libinput_device_config_dwt_is_available(device)); state = libinput_device_config_dwt_get_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DWT_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DWT_ENABLED); state = libinput_device_config_dwt_get_default_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DWT_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DWT_ENABLED); status = libinput_device_config_dwt_set_enabled(device, LIBINPUT_CONFIG_DWT_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_dwt_set_enabled(device, LIBINPUT_CONFIG_DWT_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_dwt_set_enabled(device, 3); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -4722,19 +4722,19 @@ START_TEST(touchpad_dwtp_config_default_on) litest_assert(libinput_device_config_dwtp_is_available(device)); state = libinput_device_config_dwtp_get_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DWTP_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DWTP_ENABLED); state = libinput_device_config_dwtp_get_default_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DWTP_ENABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DWTP_ENABLED); status = libinput_device_config_dwtp_set_enabled(device, LIBINPUT_CONFIG_DWTP_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_dwtp_set_enabled(device, LIBINPUT_CONFIG_DWTP_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_dwtp_set_enabled(device, 3); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -4747,19 +4747,19 @@ START_TEST(touchpad_dwt_config_default_off) litest_assert(!libinput_device_config_dwt_is_available(device)); state = libinput_device_config_dwt_get_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DWT_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DWT_DISABLED); state = libinput_device_config_dwt_get_default_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DWT_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DWT_DISABLED); status = libinput_device_config_dwt_set_enabled(device, LIBINPUT_CONFIG_DWT_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_dwt_set_enabled(device, LIBINPUT_CONFIG_DWT_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_dwt_set_enabled(device, 3); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -4772,19 +4772,19 @@ START_TEST(touchpad_dwtp_config_default_off) litest_assert(!libinput_device_config_dwtp_is_available(device)); state = libinput_device_config_dwtp_get_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DWTP_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DWTP_DISABLED); state = libinput_device_config_dwtp_get_default_enabled(device); - litest_assert_int_eq(state, LIBINPUT_CONFIG_DWTP_DISABLED); + litest_assert_enum_eq(state, LIBINPUT_CONFIG_DWTP_DISABLED); status = libinput_device_config_dwtp_set_enabled(device, LIBINPUT_CONFIG_DWTP_ENABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); status = libinput_device_config_dwtp_set_enabled(device, LIBINPUT_CONFIG_DWTP_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_dwtp_set_enabled(device, 3); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -6015,7 +6015,7 @@ START_TEST(touchpad_disabled_on_mouse) status = libinput_device_config_send_events_set_mode( dev->libinput_device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(dev, 0, 20, 30); litest_touch_move_to(dev, 0, 20, 30, 90, 30, 10); @@ -6052,7 +6052,7 @@ START_TEST(touchpad_disabled_on_mouse_suspend_mouse) status = libinput_device_config_send_events_set_mode( dev->libinput_device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(dev, 0, 20, 30); litest_touch_move_to(dev, 0, 20, 30, 90, 30, 10); @@ -6066,7 +6066,7 @@ START_TEST(touchpad_disabled_on_mouse_suspend_mouse) status = libinput_device_config_send_events_set_mode( mouse->libinput_device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(dev, 0, 20, 30); litest_touch_move_to(dev, 0, 20, 30, 90, 30, 10); @@ -6095,7 +6095,7 @@ START_TEST(touchpad_disabled_double_mouse) status = libinput_device_config_send_events_set_mode( dev->libinput_device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(dev, 0, 20, 30); litest_touch_move_to(dev, 0, 20, 30, 90, 30, 10); @@ -6141,7 +6141,7 @@ START_TEST(touchpad_disabled_double_mouse_one_suspended) status = libinput_device_config_send_events_set_mode( dev->libinput_device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(dev, 0, 20, 30); litest_touch_move_to(dev, 0, 20, 30, 90, 30, 10); @@ -6156,7 +6156,7 @@ START_TEST(touchpad_disabled_double_mouse_one_suspended) status = libinput_device_config_send_events_set_mode( mouse1->libinput_device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(dev, 0, 20, 30); litest_touch_move_to(dev, 0, 20, 30, 90, 30, 10); diff --git a/test/test-trackball.c b/test/test-trackball.c index 4669b1c6..ea089250 100644 --- a/test/test-trackball.c +++ b/test/test-trackball.c @@ -54,11 +54,11 @@ START_TEST(trackball_rotation_config_invalid_range) enum libinput_config_status status; status = libinput_device_config_rotation_set_angle(device, 360); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); status = libinput_device_config_rotation_set_angle(device, 361); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); status = libinput_device_config_rotation_set_angle(device, -1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_INVALID); } END_TEST @@ -78,12 +78,12 @@ START_TEST(trackball_rotation_config_no_rotation) /* 0 always succeeds */ status = libinput_device_config_rotation_set_angle(device, 0); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); for (angle = 1; angle < 360; angle++) { status = libinput_device_config_rotation_set_angle(device, angle); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_UNSUPPORTED); } } END_TEST @@ -100,7 +100,7 @@ START_TEST(trackball_rotation_config_right_angle) for (angle = 0; angle < 360; angle += 90) { status = libinput_device_config_rotation_set_angle(device, angle); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); } } END_TEST @@ -117,7 +117,7 @@ START_TEST(trackball_rotation_config_odd_angle) for (angle = 0; angle < 360; angle++) { status = libinput_device_config_rotation_set_angle(device, angle); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); } } END_TEST diff --git a/test/test-trackpoint.c b/test/test-trackpoint.c index a92d908a..3bb5f7c8 100644 --- a/test/test-trackpoint.c +++ b/test/test-trackpoint.c @@ -165,7 +165,7 @@ START_TEST(trackpoint_scroll_source) while ((event = libinput_get_event(li))) { ptrev = libinput_event_get_pointer_event(event); - litest_assert_int_eq(litest_event_pointer_get_axis_source(ptrev), + litest_assert_enum_eq(litest_event_pointer_get_axis_source(ptrev), LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS); libinput_event_destroy(event); @@ -189,7 +189,7 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_trackpoint) /* touchpad right-handed, trackpoint left-handed */ status = libinput_device_config_left_handed_set( trackpoint->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(touchpad, 0, 5, 5); litest_dispatch(li); @@ -234,7 +234,7 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_touchpad) /* touchpad left-handed, trackpoint right-handed */ status = libinput_device_config_left_handed_set( touchpad->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(touchpad, 0, 5, 5); litest_dispatch(li); @@ -277,10 +277,10 @@ START_TEST(trackpoint_topsoftbuttons_left_handed_both) /* touchpad left-handed, trackpoint left-handed */ status = libinput_device_config_left_handed_set( touchpad->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); status = libinput_device_config_left_handed_set( trackpoint->libinput_device, 1); - litest_assert_int_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); + litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS); litest_touch_down(touchpad, 0, 5, 5); litest_dispatch(li); @@ -316,7 +316,7 @@ enable_dwtp(struct litest_device *dev) expected = LIBINPUT_CONFIG_STATUS_SUCCESS; status = libinput_device_config_dwtp_set_enabled(dev->libinput_device, LIBINPUT_CONFIG_DWTP_ENABLED); - litest_assert_int_eq(status, expected); + litest_assert_enum_eq(status, expected); } static inline void @@ -326,7 +326,7 @@ disable_dwtp(struct litest_device *dev) expected = LIBINPUT_CONFIG_STATUS_SUCCESS; status = libinput_device_config_dwtp_set_enabled(dev->libinput_device, LIBINPUT_CONFIG_DWTP_DISABLED); - litest_assert_int_eq(status, expected); + litest_assert_enum_eq(status, expected); } diff --git a/test/test-udev.c b/test/test-udev.c index 1ee3390f..22307026 100644 --- a/test/test-udev.c +++ b/test/test-udev.c @@ -265,14 +265,14 @@ START_TEST(udev_change_seat) litest_dispatch(li); event = libinput_get_event(li); - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_DEVICE_REMOVED); litest_assert(libinput_event_get_device(event) == device); libinput_event_destroy(event); event = libinput_get_event(li); - litest_assert_int_eq(libinput_event_get_type(event), + litest_assert_enum_eq(libinput_event_get_type(event), LIBINPUT_EVENT_DEVICE_ADDED); litest_assert(libinput_event_get_device(event) != device); libinput_device_unref(device); |