Enable warnings when compiling and fix a few.
authorChristopher Peplin <chris.peplin@rhubarbtech.com>
Tue, 7 Jan 2014 05:08:39 +0000 (00:08 -0500)
committerChristopher Peplin <chris.peplin@rhubarbtech.com>
Tue, 7 Jan 2014 05:08:39 +0000 (00:08 -0500)
Makefile
deps/bitfield-c
tests/common.c
tests/test_send.c

index f44f8cd..fe84163 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 CC = gcc
 INCLUDES = -Isrc -Ideps/bitfield-c/src
-CFLAGS = $(INCLUDES) -c -w -Wall -Werror -g -ggdb -std=gnu++0x -coverage
+CFLAGS = $(INCLUDES) -c -Wall -Werror -g -ggdb -std=gnu99 -coverage
 LDFLAGS = -coverage -lm
 LDLIBS = -lcheck
 
index eab0c42..7f1d547 160000 (submodule)
@@ -1 +1 @@
-Subproject commit eab0c42eac865a7e965878a7f2ad548371bd34d5
+Subproject commit 7f1d5473842361f97fef886bc4e98949ecf853b6
index f9898b3..d062db5 100644 (file)
@@ -3,6 +3,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <string.h>
 
 IsoTpShims SHIMS;
 IsoTpReceiveHandle RECEIVE_HANDLE;
@@ -30,7 +31,7 @@ void debug(const char* format, ...) {
     va_end(args);
 }
 
-void mock_send_can(const uint16_t arbitration_id, const uint8_t* data,
+bool mock_send_can(const uint16_t arbitration_id, const uint8_t* data,
         const uint8_t size) {
     can_frame_was_sent = true;
     last_can_frame_sent_arb_id = arbitration_id;
@@ -38,9 +39,7 @@ void mock_send_can(const uint16_t arbitration_id, const uint8_t* data,
     if(size > 0) {
         memcpy(last_can_payload_sent, data, size);
     }
-}
-
-void mock_set_timer(uint16_t time_ms, void (*callback)) {
+    return true;
 }
 
 void message_received(const IsoTpMessage* message) {
@@ -80,7 +79,7 @@ void can_frame_sent(const uint16_t arbitration_id, const uint8_t* payload,
 }
 
 void setup() {
-    SHIMS = isotp_init_shims(debug, mock_send_can, mock_set_timer);
+    SHIMS = isotp_init_shims(debug, mock_send_can, NULL);
     RECEIVE_HANDLE = isotp_receive(&SHIMS, 0x2a, message_received);
     memset(last_message_sent_payload, 0, OUR_MAX_ISO_TP_MESSAGE_SIZE);
     memset(last_message_received_payload, 0, OUR_MAX_ISO_TP_MESSAGE_SIZE);
index 7944e6f..fecb259 100644 (file)
@@ -48,8 +48,7 @@ START_TEST (test_send_single_frame)
 {
     const uint8_t payload[] = {0x12, 0x34};
     uint16_t arbitration_id = 0x2a;
-    IsoTpSendHandle handle = isotp_send(&SHIMS, arbitration_id, payload,
-            sizeof(payload), message_sent);
+    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);
     ck_assert_int_eq(last_message_sent_payload[0], 0x12);