summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-02 15:28:52 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-02 15:28:52 -0500
commite3637d97ecaef1768d3f9ef40cb0204a0e668ff2 (patch)
treea1f2db1c34cfde48fe8533877015556ba7309c30 /tests
parentfe20a273bb3979d9e806d828486633249d073ede (diff)
Only mark handle as completed when fully received.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_receive.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_receive.c b/tests/test_receive.c
index 2ce3feff..5c757076 100644
--- a/tests/test_receive.c
+++ b/tests/test_receive.c
@@ -28,6 +28,7 @@ extern void setup();
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(message.completed);
fail_if(message_was_received);
@@ -47,7 +48,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_unless(message.completed);
fail_unless(message_was_received);
ck_assert_int_eq(last_message_received_arb_id, 0x2a);