test: don't try to print axis values that aren't set

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2015-08-05 09:45:45 +10:00
parent 254f87564f
commit 2ee2bebb34

View file

@ -1834,12 +1834,17 @@ litest_print_event(struct libinput_event *event)
break; break;
case LIBINPUT_EVENT_POINTER_AXIS: case LIBINPUT_EVENT_POINTER_AXIS:
p = libinput_event_get_pointer_event(event); p = libinput_event_get_pointer_event(event);
fprintf(stderr, x = 0.0;
"vert %.f horiz %.2f", y = 0.0;
libinput_event_pointer_get_axis_value(p, if (libinput_event_pointer_has_axis(p,
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL), LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))
libinput_event_pointer_get_axis_value(p, y = libinput_event_pointer_get_axis_value(p,
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL)); LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
if (libinput_event_pointer_has_axis(p,
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL))
x = libinput_event_pointer_get_axis_value(p,
LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
fprintf(stderr, "vert %.f horiz %.2f", y, x);
break; break;
default: default:
break; break;