|
|
|
@ -47,11 +47,26 @@ static void test_deserialize_clipboard_big(void) {
|
|
|
|
device_msg_destroy(&msg);
|
|
|
|
device_msg_destroy(&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void test_deserialize_ack_set_clipboard(void) {
|
|
|
|
|
|
|
|
const unsigned char input[] = {
|
|
|
|
|
|
|
|
DEVICE_MSG_TYPE_ACK_CLIPBOARD,
|
|
|
|
|
|
|
|
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // sequence
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct device_msg msg;
|
|
|
|
|
|
|
|
ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
|
|
|
|
|
|
|
|
assert(r == 9);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert(msg.type == DEVICE_MSG_TYPE_ACK_CLIPBOARD);
|
|
|
|
|
|
|
|
assert(msg.ack_clipboard.sequence == UINT64_C(0x0102030405060708));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
(void) argc;
|
|
|
|
(void) argc;
|
|
|
|
(void) argv;
|
|
|
|
(void) argv;
|
|
|
|
|
|
|
|
|
|
|
|
test_deserialize_clipboard();
|
|
|
|
test_deserialize_clipboard();
|
|
|
|
test_deserialize_clipboard_big();
|
|
|
|
test_deserialize_clipboard_big();
|
|
|
|
|
|
|
|
test_deserialize_ack_set_clipboard();
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|