Lines Matching refs:msg
19 static void fill_TestMessage(TestMessage *msg) in fill_TestMessage() argument
21 msg->static_req_submsg.dynamic_str = "12345"; in fill_TestMessage()
22 msg->static_req_submsg.dynamic_str_arr_count = 3; in fill_TestMessage()
23 msg->static_req_submsg.dynamic_str_arr = test_str_arr; in fill_TestMessage()
24 msg->static_req_submsg.dynamic_submsg_count = 2; in fill_TestMessage()
25 msg->static_req_submsg.dynamic_submsg = test_msg_arr; in fill_TestMessage()
26 msg->static_req_submsg.dynamic_submsg[1].dynamic_str = "abc"; in fill_TestMessage()
27 msg->static_opt_submsg.dynamic_str = "abc"; in fill_TestMessage()
28 msg->static_rep_submsg_count = 2; in fill_TestMessage()
29 msg->static_rep_submsg[1].dynamic_str = "abc"; in fill_TestMessage()
30 msg->has_static_opt_submsg = true; in fill_TestMessage()
31 msg->dynamic_submsg = &msg->static_req_submsg; in fill_TestMessage()
33 msg->extensions = &ext1; in fill_TestMessage()
35 ext1.dest = &msg->static_req_submsg; in fill_TestMessage()
38 ext2.dest = &msg->static_req_submsg; in fill_TestMessage()
50 TestMessage msg = TestMessage_init_zero; in test_TestMessage() local
53 fill_TestMessage(&msg); in test_TestMessage()
56 if (!pb_encode(&stream, TestMessage_fields, &msg)) in test_TestMessage()
70 TestMessage msg = TestMessage_init_zero; in test_TestMessage() local
74 msg.extensions = &ext1; in test_TestMessage()
83 if (!pb_decode(&stream, TestMessage_fields, &msg)) in test_TestMessage()
93 TEST(pb_encode(&ostream, TestMessage_fields, &msg)); in test_TestMessage()
102 pb_release(TestMessage_fields, &msg); in test_TestMessage()
106 pb_release(TestMessage_fields, &msg); in test_TestMessage()
124 OneofMessage msg = OneofMessage_init_zero; in test_OneofMessage() local
125 msg.which_msgs = OneofMessage_msg1_tag; in test_OneofMessage()
127 fill_TestMessage(&msg.msgs.msg1); in test_OneofMessage()
129 if (!pb_encode(&stream, OneofMessage_fields, &msg)) in test_OneofMessage()
138 OneofMessage msg = OneofMessage_init_zero; in test_OneofMessage() local
140 msg.which_msgs = OneofMessage_msg2_tag; in test_OneofMessage()
142 msg.first = 999; in test_OneofMessage()
143 msg.msgs.msg2.dynamic_str = "ABCD"; in test_OneofMessage()
144 msg.msgs.msg2.dynamic_str_arr_count = 1; in test_OneofMessage()
145 msg.msgs.msg2.dynamic_str_arr = &teststr; in test_OneofMessage()
146 msg.last = 888; in test_OneofMessage()
148 if (!pb_encode(&stream, OneofMessage_fields, &msg)) in test_OneofMessage()
157 OneofMessage msg = OneofMessage_init_zero; in test_OneofMessage() local
159 msg.which_msgs = OneofMessage_msg2_tag; in test_OneofMessage()
161 msg.first = 99; in test_OneofMessage()
162 msg.msgs.msg2.dynamic_str = "EFGH"; in test_OneofMessage()
163 msg.msgs.msg2.dynamic_str_arr_count = 1; in test_OneofMessage()
164 msg.msgs.msg2.dynamic_str_arr = &teststr; in test_OneofMessage()
165 msg.last = 88; in test_OneofMessage()
167 if (!pb_encode(&stream, OneofMessage_fields, &msg)) in test_OneofMessage()
177 OneofMessage msg = OneofMessage_init_zero; in test_OneofMessage() local
179 if (!pb_decode(&stream, OneofMessage_fields, &msg)) in test_OneofMessage()
185 TEST(msg.first == 99); in test_OneofMessage()
186 TEST(msg.which_msgs == OneofMessage_msg2_tag); in test_OneofMessage()
187 TEST(msg.msgs.msg2.dynamic_str); in test_OneofMessage()
188 TEST(strcmp(msg.msgs.msg2.dynamic_str, "EFGH") == 0); in test_OneofMessage()
189 TEST(msg.msgs.msg2.dynamic_str_arr != NULL); in test_OneofMessage()
190 TEST(msg.msgs.msg2.dynamic_str_arr_count == 2); in test_OneofMessage()
191 TEST(strcmp(msg.msgs.msg2.dynamic_str_arr[0], "1") == 0); in test_OneofMessage()
192 TEST(strcmp(msg.msgs.msg2.dynamic_str_arr[1], "2") == 0); in test_OneofMessage()
193 TEST(msg.msgs.msg2.dynamic_submsg == NULL); in test_OneofMessage()
194 TEST(msg.last == 88); in test_OneofMessage()
196 pb_release(OneofMessage_fields, &msg); in test_OneofMessage()
198 pb_release(OneofMessage_fields, &msg); in test_OneofMessage()
217 OneofMessage msg = OneofMessage_init_zero; in test_Garbage() local
219 TEST(!pb_decode(&stream, OneofMessage_fields, &msg)); in test_Garbage()
223 TestMessage msg = TestMessage_init_zero; in test_Garbage() local
225 TEST(!pb_decode(&stream, TestMessage_fields, &msg)); in test_Garbage()
229 RepeatedMessage msg = RepeatedMessage_init_zero; in test_Garbage() local
231 msg.subs.arg = NULL; in test_Garbage()
232 msg.subs.funcs.decode = dummy_decode_cb; in test_Garbage()
233 TEST(!pb_decode(&stream, RepeatedMessage_fields, &msg)); in test_Garbage()