diff options
Diffstat (limited to 'tests/test_receive.c')
-rw-r--r-- | tests/test_receive.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_receive.c b/tests/test_receive.c index 95afb949..1452ed3e 100644 --- a/tests/test_receive.c +++ b/tests/test_receive.c @@ -6,7 +6,7 @@ #include <stdarg.h> extern IsoTpShims SHIMS; -extern IsoTpHandle HANDLE; +extern IsoTpReceiveHandle RECEIVE_HANDLE; extern uint16_t last_can_frame_sent_arb_id; extern uint8_t last_can_payload_sent; @@ -28,8 +28,8 @@ extern void setup(); START_TEST (test_receive_empty_can_message) { const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0}; - fail_if(HANDLE.completed); - IsoTpMessage message = isotp_receive_can_frame(&SHIMS, &HANDLE, 0x100, data, 0); + fail_if(RECEIVE_HANDLE.completed); + IsoTpMessage message = isotp_continue_receive(&SHIMS, &RECEIVE_HANDLE, 0x100, data, 0); fail_if(message.completed); fail_if(message_was_received); } @@ -38,8 +38,8 @@ END_TEST START_TEST (test_receive_wrong_id) { const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0}; - fail_if(HANDLE.completed); - IsoTpMessage message = isotp_receive_can_frame(&SHIMS, &HANDLE, 0x100, data, 1); + fail_if(RECEIVE_HANDLE.completed); + IsoTpMessage message = isotp_continue_receive(&SHIMS, &RECEIVE_HANDLE, 0x100, data, 1); fail_if(message.completed); fail_if(message_was_received); } @@ -49,7 +49,7 @@ START_TEST (test_receive_bad_pci) { // 4 is a reserved number for the PCI field - only 0-3 are allowed const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0x40}; - IsoTpMessage message = isotp_receive_can_frame(&SHIMS, &HANDLE, 0x2a, data, 1); + IsoTpMessage message = isotp_continue_receive(&SHIMS, &RECEIVE_HANDLE, 0x2a, data, 1); fail_if(message.completed); fail_if(message_was_received); } @@ -58,9 +58,9 @@ END_TEST START_TEST (test_receive_single_frame_empty_payload) { const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0x00, 0x12, 0x34}; - fail_if(HANDLE.completed); - IsoTpMessage message = isotp_receive_can_frame(&SHIMS, &HANDLE, 0x2a, data, 3); - fail_unless(HANDLE.completed); + fail_if(RECEIVE_HANDLE.completed); + IsoTpMessage message = isotp_continue_receive(&SHIMS, &RECEIVE_HANDLE, 0x2a, data, 3); + fail_unless(RECEIVE_HANDLE.completed); fail_unless(message.completed); fail_unless(message_was_received); ck_assert_int_eq(last_message_received_arb_id, 0x2a); @@ -71,7 +71,7 @@ END_TEST START_TEST (test_receive_single_frame) { const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0x02, 0x12, 0x34}; - IsoTpMessage message = isotp_receive_can_frame(&SHIMS, &HANDLE, 0x2a, data, 3); + IsoTpMessage message = isotp_continue_receive(&SHIMS, &RECEIVE_HANDLE, 0x2a, data, 3); fail_unless(message.completed); fail_unless(message_was_received); ck_assert_int_eq(last_message_received_arb_id, 0x2a); |