From 546b7623a33597b0517b845afe1119a9840c4e69 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 8 Oct 2020 12:27:37 +1000 Subject: [PATCH] test: fix the tablet relative calibration test This test only worked because axis smoothing mangled the coordinates, moving from 5/10 to 10/20 cannot possibly have a dx of zero. Signed-off-by: Peter Hutterer --- test/test-tablet.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/test-tablet.c b/test/test-tablet.c index a0a8de83..0c4fbea7 100644 --- a/test/test-tablet.c +++ b/test/test-tablet.c @@ -4682,6 +4682,12 @@ START_TEST(relative_calibration) ck_assert(dy == 0.0); libinput_event_destroy(event); + /* work around axis smoothing */ + litest_tablet_motion(dev, 19, 10, axes); + litest_tablet_motion(dev, 18, 10, axes); + litest_tablet_motion(dev, 17, 10, axes); + litest_drain_events(li); + litest_tablet_motion(dev, 5, 10, axes); libinput_dispatch(li); event = libinput_get_event(li); @@ -4693,7 +4699,13 @@ START_TEST(relative_calibration) ck_assert(dy == 0.0); libinput_event_destroy(event); - litest_tablet_motion(dev, 10, 20, axes); + /* work around axis smoothing */ + litest_tablet_motion(dev, 5, 11, axes); + litest_tablet_motion(dev, 5, 12, axes); + litest_tablet_motion(dev, 5, 13, axes); + litest_drain_events(li); + + litest_tablet_motion(dev, 5, 20, axes); libinput_dispatch(li); event = libinput_get_event(li); tev = litest_is_tablet_event(event, @@ -4704,7 +4716,13 @@ START_TEST(relative_calibration) ck_assert(dy < 0.0); libinput_event_destroy(event); - litest_tablet_motion(dev, 10, 5, axes); + /* work around axis smoothing */ + litest_tablet_motion(dev, 5, 19, axes); + litest_tablet_motion(dev, 5, 18, axes); + litest_tablet_motion(dev, 5, 17, axes); + litest_drain_events(li); + + litest_tablet_motion(dev, 5, 5, axes); libinput_dispatch(li); event = libinput_get_event(li); tev = litest_is_tablet_event(event,