From 4d30fa93ba80591d5d23cbd1627cc774ddf72351 Mon Sep 17 00:00:00 2001 From: Yu-Chen Lin Date: Sat, 26 Jan 2019 20:04:39 +0800 Subject: [PATCH] tests: fix test_control_event_serialize commit fefb9816a changed the protocol, fix the related testing case. Signed-off-by: Yu-Chen Lin --- app/tests/test_control_event_serialize.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/tests/test_control_event_serialize.c b/app/tests/test_control_event_serialize.c index 21d7909b..f6034370 100644 --- a/app/tests/test_control_event_serialize.c +++ b/app/tests/test_control_event_serialize.c @@ -87,13 +87,13 @@ static void test_serialize_mouse_event(void) { unsigned char buf[SERIALIZED_EVENT_MAX_SIZE]; int size = control_event_serialize(&event, buf); - assert(size == 14); + assert(size == 18); const unsigned char expected[] = { 0x02, // CONTROL_EVENT_TYPE_MOUSE 0x00, // AKEY_EVENT_ACTION_DOWN 0x00, 0x00, 0x00, 0x01, // AMOTION_EVENT_BUTTON_PRIMARY - 0x01, 0x04, 0x04, 0x02, // 260 1026 + 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x04, 0x02, // 260 1026 0x04, 0x38, 0x07, 0x80, // 1080 1920 }; assert(!memcmp(buf, expected, sizeof(expected))); @@ -120,11 +120,11 @@ static void test_serialize_scroll_event(void) { unsigned char buf[SERIALIZED_EVENT_MAX_SIZE]; int size = control_event_serialize(&event, buf); - assert(size == 17); + assert(size == 21); const unsigned char expected[] = { 0x03, // CONTROL_EVENT_TYPE_SCROLL - 0x01, 0x04, 0x04, 0x02, // 260 1026 + 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x04, 0x02, // 260 1026 0x04, 0x38, 0x07, 0x80, // 1080 1920 0x00, 0x00, 0x00, 0x01, // 1 0xFF, 0xFF, 0xFF, 0xFF, // -1