Provide a consistent motion event stream in libinput_tests
When the InputVerifier is enabled, some of the input tests fail because
they provide an inconsistent motion event stream to the InputPublisher.
In this CL, those are fixed. This should help us enable event
verification in the future.
There are still some failures remaining due to zero pointer tests that
will be addressed separately.
Bug: 211379801
Bug: 271455682
Test: enable InputVerifier in the code
Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST
Change-Id: If19ea9bc50d2191ba2bdce3aad35390889db7f95
diff --git a/libs/input/tests/TouchResampling_test.cpp b/libs/input/tests/TouchResampling_test.cpp
index 106d78a..1cb7f7b 100644
--- a/libs/input/tests/TouchResampling_test.cpp
+++ b/libs/input/tests/TouchResampling_test.cpp
@@ -27,6 +27,8 @@
namespace android {
+namespace {
+
struct Pointer {
int32_t id;
float x;
@@ -41,6 +43,8 @@
int32_t action;
};
+} // namespace
+
class TouchResamplingTest : public testing::Test {
protected:
std::unique_ptr<InputPublisher> mPublisher;
@@ -587,13 +591,13 @@
// First pointer id=0 leaves the screen
entries = {
// id x y
- {80ms, {{1, 600, 600}}, actionPointer0Up},
+ {80ms, {{0, 120, 120}, {1, 600, 600}}, actionPointer0Up},
};
publishInputEventEntries(entries);
frameTime = 90ms;
expectedEntries = {
// id x y
- {80ms, {{1, 600, 600}}, actionPointer0Up},
+ {80ms, {{0, 120, 120}, {1, 600, 600}}, actionPointer0Up},
// no resampled event for ACTION_POINTER_UP
};
consumeInputEventEntries(expectedEntries, frameTime);