Merge pull request #170 from kylemanna/travis-ci
[apps/agl-service-can-low-level.git] / tests / alltypes / decode_alltypes.c
index 67cb72c..458e511 100644 (file)
@@ -125,6 +125,8 @@ bool check_alltypes(pb_istream_t *stream, int mode)
         TEST(alltypes.has_opt_enum     == false);
         TEST(alltypes.opt_enum == MyEnum_Second);
         TEST(alltypes.has_opt_emptymsg == false);
+
+        TEST(alltypes.which_oneof == 0);
     }
     else
     {
@@ -170,6 +172,10 @@ bool check_alltypes(pb_istream_t *stream, int mode)
         TEST(alltypes.has_opt_enum      == true);
         TEST(alltypes.opt_enum == MyEnum_Truth);
         TEST(alltypes.has_opt_emptymsg  == true);
+
+        TEST(alltypes.which_oneof == AllTypes_oneof_msg1_tag);
+        TEST(strcmp(alltypes.oneof.oneof_msg1.substuff1, "4059") == 0);
+        TEST(alltypes.oneof.oneof_msg1.substuff2 == 4059);
     }
     
     TEST(alltypes.req_limits.int32_min  == INT32_MIN);