17 COMMENT(
"Test field iterator logic on AllTypes");
21 TEST(iter.tag == 1 && iter.pData == &msg.
req_int32 && !iter.pSize)
41 TEST(iter.required_field_index == 18)
42 TEST(iter.submessage_index == 2)
61 TEST(
pb_field_iter_next(&iter) && iter.tag == 38 && iter.pData == &msg.rep_emptymsg && iter.pSize == &msg.rep_emptymsg_count)
62 TEST(
pb_field_iter_next(&iter) && iter.tag == 39 && iter.pData == &msg.rep_fbytes && iter.pSize == &msg.rep_fbytes_count)
63 TEST(
pb_field_iter_next(&iter) && iter.tag == 40 && iter.pData == &msg.rep_farray && iter.pSize == &iter.array_size && iter.array_size == 5)
64 TEST(iter.required_field_index == 19)
65 TEST(iter.submessage_index == 4)
84 TEST(
pb_field_iter_next(&iter) && iter.tag == 58 && iter.pData == &msg.opt_emptymsg && iter.pSize == &msg.has_opt_emptymsg)
85 TEST(
pb_field_iter_next(&iter) && iter.tag == 59 && iter.pData == &msg.opt_fbytes && iter.pSize == &msg.has_opt_fbytes)
86 TEST(iter.required_field_index == 19)
87 TEST(iter.submessage_index == 6)
89 TEST(
pb_field_iter_next(&iter) && iter.tag == 60 && iter.pData == &msg.oneof.oneof_msg1 && iter.pSize == &msg.which_oneof )
90 TEST(
pb_field_iter_next(&iter) && iter.tag == 61 && iter.pData == &msg.oneof.oneof_msg2 && iter.pSize == &msg.which_oneof )
91 TEST(
pb_field_iter_next(&iter) && iter.tag == 62 && iter.pData == &msg.opt_non_zero_based_enum && iter.pSize == &msg.has_opt_non_zero_based_enum)
92 TEST(
pb_field_iter_next(&iter) && iter.tag == 63 && iter.pData == &msg.oneof.static_msg && iter.pSize == &msg.which_oneof )
93 TEST(iter.required_field_index == 19)
94 TEST(iter.submessage_index == 8)
96 TEST(
pb_field_iter_next(&iter) && iter.tag == 95 && iter.pData == &msg.rep_farray2 && iter.pSize == &iter.array_size && iter.array_size == 3)
97 TEST(iter.required_field_index == 19)
98 TEST(iter.submessage_index == 9)
101 TEST(iter.required_field_index == 19)
102 TEST(iter.submessage_index == 9)
105 TEST(iter.required_field_index == 20)
106 TEST(iter.submessage_index == 10)
109 TEST(iter.required_field_index == 21)
110 TEST(iter.submessage_index == 11)
113 TEST(iter.required_field_index == 22)
114 TEST(iter.submessage_index == 12)
117 TEST(iter.required_field_index == 22)
118 TEST(iter.submessage_index == 12)
122 TEST(iter.tag == 1 && iter.pData == &msg.
req_int32 && !iter.pSize)
123 TEST(iter.required_field_index == 0)
124 TEST(iter.submessage_index == 0)
128 COMMENT(
"Test pb_validate_utf8()");
130 TEST(pb_validate_utf8(
"abcdefg"));
131 TEST(pb_validate_utf8(
"\xc3\xa4\xc3\xa4\x6b\x6b\xc3\xb6\x6e\x65\x6e\x0a"));
132 TEST(!pb_validate_utf8(
"\xc3\xa4\xc3\xa4\x6b\x6b\xb6\xc3\x6e\x65\x6e\x0a"));
133 TEST(pb_validate_utf8(
"\xed\x9f\xbf"));
134 TEST(pb_validate_utf8(
"\xee\x80\x80"));
135 TEST(pb_validate_utf8(
"\xef\xbf\xbd"));
136 TEST(pb_validate_utf8(
"\xf4\x8f\xbf\xbf"));
137 TEST(!pb_validate_utf8(
"a\x80z"));
138 TEST(!pb_validate_utf8(
"a\xbfz"));
139 TEST(!pb_validate_utf8(
"a\xfez"));
140 TEST(!pb_validate_utf8(
"a\xffz"));
141 TEST(!pb_validate_utf8(
"a\xc0\xafz"));
142 TEST(!pb_validate_utf8(
"a\xef\xbf\xbez"));
146 fprintf(
stdout,
"\n\nSome tests FAILED!\n");