Merge pull request #170 from kylemanna/travis-ci
[apps/agl-service-can-low-level.git] / tests / oneof / decode_oneof.c
index 83b4702..37075cd 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <pb_decode.h>
 #include "oneof.pb.h"
 #include "test_helpers.h"
 /* Test the 'OneOfMessage' */
 int test_oneof_1(pb_istream_t *stream, int option)
 {
-    OneOfMessage msg = OneOfMessage_init_zero;
+    OneOfMessage msg;
     int status = 0;
 
+    /* To better catch initialization errors */
+    memset(&msg, 0xAA, sizeof(msg));
+
     if (!pb_decode(stream, OneOfMessage_fields, &msg))
     {
         printf("Decoding failed: %s\n", PB_GET_ERROR(stream));
@@ -124,4 +128,4 @@ int main(int argc, char **argv)
     }
 
     return 0;
-}
\ No newline at end of file
+}