Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b03f103f authored by Michael Wright's avatar Michael Wright
Browse files

Fix input tests to work with new MotionEvent member

Change-Id: I0dde0f91f693903f26edc116b5dbcbf33bac2b93
parent 7b159c9a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ void MotionEventTest::initializeEventWithHistory(MotionEvent* event) {
    pointerCoords[1].setAxisValue(AMOTION_EVENT_AXIS_TOOL_MAJOR, 26);
    pointerCoords[1].setAxisValue(AMOTION_EVENT_AXIS_TOOL_MINOR, 27);
    pointerCoords[1].setAxisValue(AMOTION_EVENT_AXIS_ORIENTATION, 28);
    event->initialize(2, AINPUT_SOURCE_TOUCHSCREEN, AMOTION_EVENT_ACTION_MOVE,
    event->initialize(2, AINPUT_SOURCE_TOUCHSCREEN, AMOTION_EVENT_ACTION_MOVE, 0,
            AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED,
            AMOTION_EVENT_EDGE_FLAG_TOP, AMETA_ALT_ON, AMOTION_EVENT_BUTTON_PRIMARY,
            X_OFFSET, Y_OFFSET, 2.0f, 2.1f,
@@ -557,7 +557,7 @@ TEST_F(MotionEventTest, Transform) {
        pointerCoords[i].setAxisValue(AMOTION_EVENT_AXIS_ORIENTATION, angle);
    }
    MotionEvent event;
    event.initialize(0, 0, AMOTION_EVENT_ACTION_MOVE, 0, 0, 0, 0,
    event.initialize(0, 0, AMOTION_EVENT_ACTION_MOVE, 0, 0, 0, 0, 0,
            0, 0, 0, 0, 0, 0, pointerCount, pointerProperties, pointerCoords);
    float originalRawX = 0 + 3;
    float originalRawY = -RADIUS + 2;
+5 −4
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ void InputPublisherAndConsumerTest::PublishAndConsumeMotionEvent() {
    const int32_t deviceId = 1;
    const int32_t source = AINPUT_SOURCE_TOUCHSCREEN;
    const int32_t action = AMOTION_EVENT_ACTION_MOVE;
    const int32_t actionButton = 0;
    const int32_t flags = AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED;
    const int32_t edgeFlags = AMOTION_EVENT_EDGE_FLAG_TOP;
    const int32_t metaState = AMETA_ALT_LEFT_ON | AMETA_ALT_ON;
@@ -163,8 +164,8 @@ void InputPublisherAndConsumerTest::PublishAndConsumeMotionEvent() {
        pointerCoords[i].setAxisValue(AMOTION_EVENT_AXIS_ORIENTATION, 3.5 * i);
    }

    status = mPublisher->publishMotionEvent(seq, deviceId, source, action, flags, edgeFlags,
            metaState, buttonState, xOffset, yOffset, xPrecision, yPrecision,
    status = mPublisher->publishMotionEvent(seq, deviceId, source, action, actionButton,
            flags, edgeFlags, metaState, buttonState, xOffset, yOffset, xPrecision, yPrecision,
            downTime, eventTime, pointerCount,
            pointerProperties, pointerCoords);
    ASSERT_EQ(OK, status)
@@ -255,7 +256,7 @@ TEST_F(InputPublisherAndConsumerTest, PublishMotionEvent_WhenPointerCountLessTha
    PointerProperties pointerProperties[pointerCount];
    PointerCoords pointerCoords[pointerCount];

    status = mPublisher->publishMotionEvent(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    status = mPublisher->publishMotionEvent(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
            pointerCount, pointerProperties, pointerCoords);
    ASSERT_EQ(BAD_VALUE, status)
            << "publisher publishMotionEvent should return BAD_VALUE";
@@ -271,7 +272,7 @@ TEST_F(InputPublisherAndConsumerTest, PublishMotionEvent_WhenPointerCountGreater
        pointerCoords[i].clear();
    }

    status = mPublisher->publishMotionEvent(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    status = mPublisher->publishMotionEvent(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
            pointerCount, pointerProperties, pointerCoords);
    ASSERT_EQ(BAD_VALUE, status)
            << "publisher publishMotionEvent should return BAD_VALUE";
+5 −4
Original line number Diff line number Diff line
@@ -51,10 +51,11 @@ void TestInputMessageAlignment() {
  CHECK_OFFSET(InputMessage::Body::Motion, deviceId, 16);
  CHECK_OFFSET(InputMessage::Body::Motion, source, 20);
  CHECK_OFFSET(InputMessage::Body::Motion, action, 24);
  CHECK_OFFSET(InputMessage::Body::Motion, flags, 28);
  CHECK_OFFSET(InputMessage::Body::Motion, metaState, 32);
  CHECK_OFFSET(InputMessage::Body::Motion, buttonState, 36);
  CHECK_OFFSET(InputMessage::Body::Motion, edgeFlags, 40);
  CHECK_OFFSET(InputMessage::Body::Motion, actionButton, 28);
  CHECK_OFFSET(InputMessage::Body::Motion, flags, 32);
  CHECK_OFFSET(InputMessage::Body::Motion, metaState, 36);
  CHECK_OFFSET(InputMessage::Body::Motion, buttonState, 40);
  CHECK_OFFSET(InputMessage::Body::Motion, edgeFlags, 44);
  CHECK_OFFSET(InputMessage::Body::Motion, downTime, 48);
  CHECK_OFFSET(InputMessage::Body::Motion, xOffset, 56);
  CHECK_OFFSET(InputMessage::Body::Motion, yOffset, 60);
+1 −1

File changed.

Contains only whitespace changes.