Skip to content
  • Jonas Ådahl's avatar
    test/pointer: Don't rely on velocities in direction change test · 6e264932
    Jonas Ådahl authored
    
    
    We currently rely on an extra millisecond being added by the filter
    code to get a velocity that are small enough to not hit the max
    acceleration limit. If this arbitrary millisecond is changed (for
    example by changing the internal time measurment to microseconds and
    adding just a microsecond instead), the velocity may change so that the
    maximum or minimum acceleration is always hit.
    
    Adding a delay to the test won't work either since it would not only rely
    on ending up within the acceleration limits but there would also be an
    non-deterministic actual delay causing the velocity of the movement
    after the direction change to be potentially larger than the movement
    in the original direction due to the actual time delta in libinput will
    not always be 1ms.
    
    To fix the test to not rely on any artificial delays in the filter code
    nor any non-deterministic delays in the test, lets just test that the
    direction change of the hardware events resulted in a direction change
    of the libinput motion events.
    
    Signed-off-by: default avatarJonas Ådahl <jadahl@gmail.com>
    Reviewed-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
    6e264932