[PATCH libinput 1/5] test: rename a parameter to litest_assert_scroll()

Hans de Goede hdegoede at redhat.com
Mon Nov 10 01:01:51 PST 2014


Hi,

On 11/10/2014 03:33 AM, Peter Hutterer wrote:
> 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 at who-t.net>

Series looks good and is:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans

> ---
>  test/litest.c | 8 ++++----
>  test/litest.h | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/test/litest.c b/test/litest.c
> index c64e665..c810fe7 100644
> --- a/test/litest.c
> +++ b/test/litest.c
> @@ -1099,7 +1099,7 @@ litest_assert_button_event(struct libinput *li, unsigned int button,
>  void
>  litest_assert_scroll(struct libinput *li,
>  		     enum libinput_pointer_axis axis,
> -		     int dir)
> +		     int minimum_movement)
>  {
>  	struct libinput_event *event, *next_event;
>  	struct libinput_event_pointer *ptrev;
> @@ -1117,14 +1117,14 @@ litest_assert_scroll(struct libinput *li,
>  
>  		if (next_event) {
>  			/* Normal scroll event, check dir */
> -			if (dir > 0) {
> +			if (minimum_movement > 0) {
>  				ck_assert_int_ge(
>  					libinput_event_pointer_get_axis_value(ptrev),
> -					dir);
> +					minimum_movement);
>  			} else {
>  				ck_assert_int_le(
>  					libinput_event_pointer_get_axis_value(ptrev),
> -					dir);
> +					minimum_movement);
>  			}
>  		} else {
>  			/* Last scroll event, must be 0 */
> diff --git a/test/litest.h b/test/litest.h
> index 5b0478b..aabfb73 100644
> --- a/test/litest.h
> +++ b/test/litest.h
> @@ -154,7 +154,7 @@ void litest_assert_button_event(struct libinput *li,
>  				enum libinput_button_state state);
>  void litest_assert_scroll(struct libinput *li,
>  			  enum libinput_pointer_axis axis,
> -			  int dir);
> +			  int minimum_movement);
>  
>  struct libevdev_uinput * litest_create_uinput_device(const char *name,
>  						     struct input_id *id,
> 


More information about the wayland-devel mailing list