summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-03 13:21:18 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-03 13:21:18 -0500
commit99dd20fc3d6c14d9e8af65264ad712ca6718dcdd (patch)
treea3fa93c403961cb82e5e0f3cc50b8cc20f20ea29 /tests
parent9c92fe46b5fa9a144190777b4f4811a898fb8cd7 (diff)
Test rx an empty CAN messages.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_receive.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_receive.c b/tests/test_receive.c
index d8c2392e..95afb949 100644
--- a/tests/test_receive.c
+++ b/tests/test_receive.c
@@ -25,6 +25,16 @@ extern uint8_t last_message_sent_payload_size;
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(message.completed);
+ fail_if(message_was_received);
+}
+END_TEST
+
START_TEST (test_receive_wrong_id)
{
const uint8_t data[CAN_MESSAGE_BYTE_SIZE] = {0};
@@ -79,6 +89,7 @@ Suite* testSuite(void) {
tcase_add_test(tc_core, test_receive_bad_pci);
tcase_add_test(tc_core, test_receive_single_frame);
tcase_add_test(tc_core, test_receive_single_frame_empty_payload);
+ tcase_add_test(tc_core, test_receive_empty_can_message);
suite_add_tcase(s, tc_core);
return s;