diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-08 16:02:16 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-08 16:02:16 +0000 |
commit | 994dfc943c6cb7a1564399a4999ee82098836599 (patch) | |
tree | 2c04ed018febfb97d63d0a9c28584bae58302c38 /libs/input/tests/StructLayout_test.cpp | |
parent | b288e591b5546b00c17dc78634c87aeee6af4746 (diff) | |
parent | 8c838655316b24ee30515cdffb13ead5a67aa83c (diff) | |
download | native-android12-mainline-tzdata2-release.tar.gz |
Snap for 8426163 from 8c838655316b24ee30515cdffb13ead5a67aa83c to mainline-tzdata2-releaseandroid-mainline-12.0.0_r112aml_tz2_305400500aml_tz2_305400300aml_tz2_305400100aml_tz2_304500300aml_tz2_303900110aml_tz2_303900102aml_tz2_303800002aml_tz2_303800001aml_tz2_303200001android12-mainline-tzdata2-releaseaml_tz2_305400100
Change-Id: I3f24fd1f52757411f691188c361389cd2216b5be
Diffstat (limited to 'libs/input/tests/StructLayout_test.cpp')
-rw-r--r-- | libs/input/tests/StructLayout_test.cpp | 75 |
1 files changed, 24 insertions, 51 deletions
diff --git a/libs/input/tests/StructLayout_test.cpp b/libs/input/tests/StructLayout_test.cpp index 5861d55156..1fe7bb90ca 100644 --- a/libs/input/tests/StructLayout_test.cpp +++ b/libs/input/tests/StructLayout_test.cpp @@ -34,7 +34,8 @@ void TestPointerCoordsAlignment() { void TestInputMessageAlignment() { CHECK_OFFSET(InputMessage, body, 8); - CHECK_OFFSET(InputMessage::Body::Key, eventId, 0); + CHECK_OFFSET(InputMessage::Body::Key, seq, 0); + CHECK_OFFSET(InputMessage::Body::Key, eventId, 4); CHECK_OFFSET(InputMessage::Body::Key, eventTime, 8); CHECK_OFFSET(InputMessage::Body::Key, deviceId, 16); CHECK_OFFSET(InputMessage::Body::Key, source, 20); @@ -48,8 +49,8 @@ void TestInputMessageAlignment() { CHECK_OFFSET(InputMessage::Body::Key, repeatCount, 80); CHECK_OFFSET(InputMessage::Body::Key, downTime, 88); - CHECK_OFFSET(InputMessage::Body::Motion, eventId, 0); - CHECK_OFFSET(InputMessage::Body::Motion, empty1, 4); + CHECK_OFFSET(InputMessage::Body::Motion, seq, 0); + CHECK_OFFSET(InputMessage::Body::Motion, eventId, 4); CHECK_OFFSET(InputMessage::Body::Motion, eventTime, 8); CHECK_OFFSET(InputMessage::Body::Motion, deviceId, 16); CHECK_OFFSET(InputMessage::Body::Motion, source, 20); @@ -61,52 +62,29 @@ void TestInputMessageAlignment() { CHECK_OFFSET(InputMessage::Body::Motion, metaState, 72); CHECK_OFFSET(InputMessage::Body::Motion, buttonState, 76); CHECK_OFFSET(InputMessage::Body::Motion, classification, 80); - CHECK_OFFSET(InputMessage::Body::Motion, empty2, 81); CHECK_OFFSET(InputMessage::Body::Motion, edgeFlags, 84); CHECK_OFFSET(InputMessage::Body::Motion, downTime, 88); - CHECK_OFFSET(InputMessage::Body::Motion, dsdx, 96); - CHECK_OFFSET(InputMessage::Body::Motion, dtdx, 100); - CHECK_OFFSET(InputMessage::Body::Motion, dtdy, 104); - CHECK_OFFSET(InputMessage::Body::Motion, dsdy, 108); - CHECK_OFFSET(InputMessage::Body::Motion, tx, 112); - CHECK_OFFSET(InputMessage::Body::Motion, ty, 116); - CHECK_OFFSET(InputMessage::Body::Motion, xPrecision, 120); - CHECK_OFFSET(InputMessage::Body::Motion, yPrecision, 124); - CHECK_OFFSET(InputMessage::Body::Motion, xCursorPosition, 128); - CHECK_OFFSET(InputMessage::Body::Motion, yCursorPosition, 132); - CHECK_OFFSET(InputMessage::Body::Motion, displayWidth, 136); - CHECK_OFFSET(InputMessage::Body::Motion, displayHeight, 140); - CHECK_OFFSET(InputMessage::Body::Motion, pointerCount, 144); - CHECK_OFFSET(InputMessage::Body::Motion, empty3, 148); - CHECK_OFFSET(InputMessage::Body::Motion, pointers, 152); - - CHECK_OFFSET(InputMessage::Body::Focus, eventId, 0); - CHECK_OFFSET(InputMessage::Body::Focus, hasFocus, 4); - CHECK_OFFSET(InputMessage::Body::Focus, inTouchMode, 5); - CHECK_OFFSET(InputMessage::Body::Focus, empty, 6); - - CHECK_OFFSET(InputMessage::Body::Capture, eventId, 0); - CHECK_OFFSET(InputMessage::Body::Capture, pointerCaptureEnabled, 4); - CHECK_OFFSET(InputMessage::Body::Capture, empty, 5); - - CHECK_OFFSET(InputMessage::Body::Drag, eventId, 0); - CHECK_OFFSET(InputMessage::Body::Drag, x, 4); - CHECK_OFFSET(InputMessage::Body::Drag, y, 8); - CHECK_OFFSET(InputMessage::Body::Drag, isExiting, 12); - CHECK_OFFSET(InputMessage::Body::Drag, empty, 13); - - CHECK_OFFSET(InputMessage::Body::Finished, handled, 0); - CHECK_OFFSET(InputMessage::Body::Finished, empty, 1); - CHECK_OFFSET(InputMessage::Body::Finished, consumeTime, 8); - - CHECK_OFFSET(InputMessage::Body::Timeline, eventId, 0); - CHECK_OFFSET(InputMessage::Body::Timeline, empty, 4); - CHECK_OFFSET(InputMessage::Body::Timeline, graphicsTimeline, 8); + CHECK_OFFSET(InputMessage::Body::Motion, xScale, 96); + CHECK_OFFSET(InputMessage::Body::Motion, yScale, 100); + CHECK_OFFSET(InputMessage::Body::Motion, xOffset, 104); + CHECK_OFFSET(InputMessage::Body::Motion, yOffset, 108); + CHECK_OFFSET(InputMessage::Body::Motion, xPrecision, 112); + CHECK_OFFSET(InputMessage::Body::Motion, yPrecision, 116); + CHECK_OFFSET(InputMessage::Body::Motion, xCursorPosition, 120); + CHECK_OFFSET(InputMessage::Body::Motion, yCursorPosition, 124); + CHECK_OFFSET(InputMessage::Body::Motion, pointerCount, 128); + CHECK_OFFSET(InputMessage::Body::Motion, pointers, 136); + + CHECK_OFFSET(InputMessage::Body::Focus, seq, 0); + CHECK_OFFSET(InputMessage::Body::Focus, eventId, 4); + CHECK_OFFSET(InputMessage::Body::Focus, hasFocus, 12); + CHECK_OFFSET(InputMessage::Body::Focus, inTouchMode, 14); + + CHECK_OFFSET(InputMessage::Body::Finished, seq, 0); + CHECK_OFFSET(InputMessage::Body::Finished, handled, 4); } void TestHeaderSize() { - CHECK_OFFSET(InputMessage::Header, type, 0); - CHECK_OFFSET(InputMessage::Header, seq, 4); static_assert(sizeof(InputMessage::Header) == 8); } @@ -119,13 +97,8 @@ void TestBodySize() { static_assert(sizeof(InputMessage::Body::Motion) == offsetof(InputMessage::Body::Motion, pointers) + sizeof(InputMessage::Body::Motion::Pointer) * MAX_POINTERS); - static_assert(sizeof(InputMessage::Body::Finished) == 16); - static_assert(sizeof(InputMessage::Body::Focus) == 8); - static_assert(sizeof(InputMessage::Body::Capture) == 8); - static_assert(sizeof(InputMessage::Body::Drag) == 16); - // Timeline - static_assert(GraphicsTimeline::SIZE == 2); - static_assert(sizeof(InputMessage::Body::Timeline) == 24); + static_assert(sizeof(InputMessage::Body::Finished) == 8); + static_assert(sizeof(InputMessage::Body::Focus) == 16); } // --- VerifiedInputEvent --- |