13 main_message_t message = MAIN_MESSAGE_INIT_ZERO;
16 message.lucky_number = 13;
17 message.required_number = 1;
18 message.repeated_number[0] = 1;
19 message.repeated_ints =
NULL;
21 message.my_enum1 = MY_ENUM1_ENUM_THIRD;
22 message.my_enum2 = MY_ENUM2_ENUM2_ENTRY;
23 message.my_enum3 = MY_ENUM2_ENUM2_ENTRY;
24 message.my_enum4.arg =
NULL;
26 message.string_values1 =
NULL;
27 message.string_values2[0][0] =
'a';
28 message.optional_string.arg =
NULL;
29 message.required_string[0] =
'a';
31 message.repeated_fixed32[0] = 1;
33 message.required_bytes1[0] = 0;
34 message.required_bytes2.size = 0;
35 message.repeated_bytes1_count = 0;
36 message.repeated_bytes2 =
NULL;
38 message.has_sub_message1 =
true;
39 message.sub_message1.has_test_value =
true;
40 message.sub_message1.test_value = 0;
41 message.sub_message2.arg =
NULL;
42 message.sub_message3.test_value = 0;
44 message.which_one_of_name = MAIN_MESSAGE_TEST_MESSAGE2_TAG;
45 message.one_of_name.test_message2.has_test_value =
true;
46 message.one_of_name.test_message2.test_value = 5;
48 message.which_one_of_name2 = MAIN_MESSAGE_TEST_MESSAGE5_TAG;
49 message.test_message5.test_value = 5;
51 TEST(
strcmp(
"ENTRY_FIRST", my_enum1_name(MY_ENUM1_ENTRY_FIRST)) == 0);
52 TEST(my_enum1_valid(MY_ENUM1_ENTRY_FIRST) ==
true);
53 TEST(my_enum2_valid(MY_ENUM2_ENUM2_ENTRY) ==
true);
64 main_message_t message2 = MAIN_MESSAGE_INIT_ZERO;
74 TEST(ostream2.bytes_written == ostream1.bytes_written);
75 TEST(
memcmp(buffer1, buffer2, ostream1.bytes_written) == 0);