diff options
author | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-02-27 15:53:19 -0500 |
---|---|---|
committer | Christopher Peplin <chris.peplin@rhubarbtech.com> | 2014-02-27 15:53:19 -0500 |
commit | a8f4bf42ee73ede0d2d3ddaf6c312c756c042a6b (patch) | |
tree | c41ffae2a8e08a238d5ab21fe594782317d41208 /tests | |
parent | c01a88ba1e56d455c7187a52a5e244500a0d6b0f (diff) |
Increase size of arb ID to uint32_t to fit extended IDs.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common.c | 10 | ||||
-rw-r--r-- | tests/test_core.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/common.c b/tests/common.c index d062db5d..a9eed39e 100644 --- a/tests/common.c +++ b/tests/common.c @@ -8,17 +8,17 @@ IsoTpShims SHIMS; IsoTpReceiveHandle RECEIVE_HANDLE; -uint16_t last_can_frame_sent_arb_id; +uint32_t last_can_frame_sent_arb_id; uint8_t last_can_payload_sent[8]; uint8_t last_can_payload_size; bool can_frame_was_sent; bool message_was_received; -uint16_t last_message_received_arb_id; +uint32_t last_message_received_arb_id; uint8_t last_message_received_payload[OUR_MAX_ISO_TP_MESSAGE_SIZE]; uint8_t last_message_received_payload_size; -uint16_t last_message_sent_arb_id; +uint32_t last_message_sent_arb_id; bool last_message_sent_status; uint8_t last_message_sent_payload[OUR_MAX_ISO_TP_MESSAGE_SIZE]; uint8_t last_message_sent_payload_size; @@ -31,7 +31,7 @@ void debug(const char* format, ...) { va_end(args); } -bool mock_send_can(const uint16_t arbitration_id, const uint8_t* data, +bool mock_send_can(const uint32_t arbitration_id, const uint8_t* data, const uint8_t size) { can_frame_was_sent = true; last_can_frame_sent_arb_id = arbitration_id; @@ -73,7 +73,7 @@ void message_sent(const IsoTpMessage* message, const bool success) { } } -void can_frame_sent(const uint16_t arbitration_id, const uint8_t* payload, +void can_frame_sent(const uint32_t arbitration_id, const uint8_t* payload, const uint8_t size) { debug("Sent CAN Frame with arb ID 0x%x and %d bytes", arbitration_id, size); } diff --git a/tests/test_core.c b/tests/test_core.c index 78e13e8d..73b47af0 100644 --- a/tests/test_core.c +++ b/tests/test_core.c @@ -30,7 +30,7 @@ START_TEST (test_default_frame_padding_on) { ck_assert(SHIMS.frame_padding); const uint8_t payload[] = {0x12, 0x34}; - uint16_t arbitration_id = 0x2a; + uint32_t arbitration_id = 0x2a; isotp_send(&SHIMS, arbitration_id, payload, sizeof(payload), message_sent); ck_assert_int_eq(last_message_sent_arb_id, arbitration_id); fail_unless(last_message_sent_status); @@ -44,7 +44,7 @@ START_TEST (test_disabled_frame_padding) { SHIMS.frame_padding = false; const uint8_t payload[] = {0x12, 0x34}; - uint16_t arbitration_id = 0x2a; + uint32_t arbitration_id = 0x2a; isotp_send(&SHIMS, arbitration_id, payload, sizeof(payload), message_sent); ck_assert_int_eq(last_message_sent_arb_id, arbitration_id); fail_unless(last_message_sent_status); |