mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-09 08:18:02 +02:00
test: rename a parameter to litest_assert_scroll()
This doesn't test for direction only, it tests for the minimum distance we expect in the scroll event. Rename accordingly. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
1bd5d32463
commit
d7a1addcdd
2 changed files with 5 additions and 5 deletions
|
|
@ -1105,7 +1105,7 @@ litest_assert_button_event(struct libinput *li, unsigned int button,
|
||||||
void
|
void
|
||||||
litest_assert_scroll(struct libinput *li,
|
litest_assert_scroll(struct libinput *li,
|
||||||
enum libinput_pointer_axis axis,
|
enum libinput_pointer_axis axis,
|
||||||
int dir)
|
int minimum_movement)
|
||||||
{
|
{
|
||||||
struct libinput_event *event, *next_event;
|
struct libinput_event *event, *next_event;
|
||||||
struct libinput_event_pointer *ptrev;
|
struct libinput_event_pointer *ptrev;
|
||||||
|
|
@ -1123,14 +1123,14 @@ litest_assert_scroll(struct libinput *li,
|
||||||
|
|
||||||
if (next_event) {
|
if (next_event) {
|
||||||
/* Normal scroll event, check dir */
|
/* Normal scroll event, check dir */
|
||||||
if (dir > 0) {
|
if (minimum_movement > 0) {
|
||||||
ck_assert_int_ge(
|
ck_assert_int_ge(
|
||||||
libinput_event_pointer_get_axis_value(ptrev),
|
libinput_event_pointer_get_axis_value(ptrev),
|
||||||
dir);
|
minimum_movement);
|
||||||
} else {
|
} else {
|
||||||
ck_assert_int_le(
|
ck_assert_int_le(
|
||||||
libinput_event_pointer_get_axis_value(ptrev),
|
libinput_event_pointer_get_axis_value(ptrev),
|
||||||
dir);
|
minimum_movement);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Last scroll event, must be 0 */
|
/* Last scroll event, must be 0 */
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ void litest_assert_button_event(struct libinput *li,
|
||||||
enum libinput_button_state state);
|
enum libinput_button_state state);
|
||||||
void litest_assert_scroll(struct libinput *li,
|
void litest_assert_scroll(struct libinput *li,
|
||||||
enum libinput_pointer_axis axis,
|
enum libinput_pointer_axis axis,
|
||||||
int dir);
|
int minimum_movement);
|
||||||
|
|
||||||
struct libevdev_uinput * litest_create_uinput_device(const char *name,
|
struct libevdev_uinput * litest_create_uinput_device(const char *name,
|
||||||
struct input_id *id,
|
struct input_id *id,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue