diff options
Diffstat (limited to 'tests/test_receive.c')
-rw-r--r-- | tests/test_receive.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_receive.c b/tests/test_receive.c index d624a1fc..b116dd23 100644 --- a/tests/test_receive.c +++ b/tests/test_receive.c @@ -27,8 +27,8 @@ extern void setup(); START_TEST (test_receive_wrong_id) { - const uint64_t data = 0; - isotp_receive_can_frame(&ISOTP_HANDLER, 0x100, data, sizeof(data)); + const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0}; + isotp_receive_can_frame(&ISOTP_HANDLER, 0x100, data, 1); fail_if(message_was_received); } END_TEST @@ -36,16 +36,16 @@ END_TEST START_TEST (test_receive_bad_pci) { // 4 is a reserved number for the PCI field - only 0-3 are allowed - const uint64_t data = {0x4000000000000000}; - isotp_receive_can_frame(&ISOTP_HANDLER, 0x2a, data, sizeof(data)); + const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0x40}; + isotp_receive_can_frame(&ISOTP_HANDLER, 0x2a, data, 1); fail_if(message_was_received); } END_TEST START_TEST (test_receive_single_frame_empty_payload) { - const uint64_t data = {0x0012340000000000}; - isotp_receive_can_frame(&ISOTP_HANDLER, 0x2a, data, sizeof(data)); + const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0x00, 0x12, 0x34}; + isotp_receive_can_frame(&ISOTP_HANDLER, 0x2a, data, 3); fail_unless(message_was_received); ck_assert_int_eq(last_message_received_arb_id, 0x2a); ck_assert_int_eq(last_message_received_payload_size, 0); @@ -54,8 +54,8 @@ END_TEST START_TEST (test_receive_single_frame) { - const uint64_t data = {0x0212340000000000}; - isotp_receive_can_frame(&ISOTP_HANDLER, 0x2a, data, sizeof(data)); + const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0x02, 0x12, 0x34}; + isotp_receive_can_frame(&ISOTP_HANDLER, 0x2a, data, 3); fail_unless(message_was_received); ck_assert_int_eq(last_message_received_arb_id, 0x2a); ck_assert_int_eq(last_message_received_payload_size, 2); |