selftests/hid: tablets: be stricter for some transitions
authorBenjamin Tissoires <bentiss@kernel.org>
Wed, 6 Dec 2023 10:46:04 +0000 (11:46 +0100)
committerBenjamin Tissoires <bentiss@kernel.org>
Thu, 7 Dec 2023 08:52:04 +0000 (09:52 +0100)
commitab9b82909e9baa5b559d6457487525cfd4df2738
treeb25e6f5023cf7cce9d7bdd503996fcea2ec7f94c
parent76df1f72fb258cc7da6eff5dd8db95f4e2856517
selftests/hid: tablets: be stricter for some transitions

To accommodate for legacy devices, we rely on the last state of a
transition to be valid:
for example when we test PEN_IS_OUT_OF_RANGE to PEN_IS_IN_CONTACT,
any "normal" device that reports an InRange bit would insert a
PEN_IS_IN_RANGE state between the 2.

This is of course valid, but this solution prevents to detect false
releases emitted by some firmware:
when pressing an "eraser mode" button, they might send an extra
PEN_IS_OUT_OF_RANGE that we may want to filter.

So define 2 sets of transitions: one that is the ideal behavior, and
one that is OK, it won't break user space, but we have serious doubts
if we are doing the right thing. And depending on the test, either
ask only for valid transitions, or tolerate weird ones.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jiri Kosina <jkosina@suse.com>
Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-13-c0350c2f5986@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
tools/testing/selftests/hid/tests/test_tablet.py