Lines Matching refs:TEST
58 TEST(pb_write(&stream, buffer1, sizeof(buffer1))); in main()
59 TEST(memcmp(buffer1, buffer2, sizeof(buffer1)) == 0); in main()
60 TEST(!pb_write(&stream, buffer1, 1)); in main()
61 TEST(stream.bytes_written == sizeof(buffer1)); in main()
69 TEST(pb_write(&stream, buffer1, 5)); in main()
71 TEST(!pb_write(&stream, buffer1, 5)); in main()
79 TEST(WRITES(pb_encode_varint(&s, 0), "\0")); in main()
80 TEST(WRITES(pb_encode_varint(&s, 1), "\1")); in main()
81 TEST(WRITES(pb_encode_varint(&s, 0x7F), "\x7F")); in main()
82 TEST(WRITES(pb_encode_varint(&s, 0x80), "\x80\x01")); in main()
83 TEST(WRITES(pb_encode_varint(&s, UINT32_MAX), "\xFF\xFF\xFF\xFF\x0F")); in main()
84 TEST(WRITES(pb_encode_varint(&s, UINT64_MAX), "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01")); in main()
92 TEST(WRITES(pb_encode_tag(&s, PB_WT_STRING, 5), "\x2A")); in main()
93 TEST(WRITES(pb_encode_tag(&s, PB_WT_VARINT, 99), "\x98\x06")); in main()
102 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x50")); in main()
105 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x51")); in main()
108 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x52")); in main()
111 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x55")); in main()
119 TEST(WRITES(pb_encode_string(&s, (const uint8_t*)"abcd", 4), "\x04""abcd")); in main()
120 TEST(WRITES(pb_encode_string(&s, (const uint8_t*)"abcd\x00", 5), "\x05""abcd\x00")); in main()
121 TEST(WRITES(pb_encode_string(&s, (const uint8_t*)"", 0), "\x00")); in main()
135 TEST(WRITES(pb_enc_varint(&s, &field, &value), "\x01")); in main()
138 TEST(WRITES(pb_enc_svarint(&s, &field, &max), "\xfe\xff\xff\xff\x0f")); in main()
139 TEST(WRITES(pb_enc_svarint(&s, &field, &min), "\xff\xff\xff\xff\x0f")); in main()
142 TEST(WRITES(pb_enc_svarint(&s, &field, &lmax), "\xFE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01")); in main()
143 TEST(WRITES(pb_enc_svarint(&s, &field, &lmin), "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01")); in main()
154 TEST(WRITES(pb_enc_fixed32(&s, NULL, &fvalue), "\x00\x00\x00\x00")) in main()
156 TEST(WRITES(pb_enc_fixed32(&s, NULL, &fvalue), "\x00\x00\xc6\x42")) in main()
158 TEST(WRITES(pb_enc_fixed32(&s, NULL, &fvalue), "\x4e\x61\x3c\xcb")) in main()
162 TEST(WRITES(pb_enc_fixed64(&s, NULL, &dvalue), "\x00\x00\x00\x00\x00\x00\x00\x00")) in main()
164 TEST(WRITES(pb_enc_fixed64(&s, NULL, &dvalue), "\x00\x00\x00\x00\x00\xc0\x58\x40")) in main()
166 TEST(WRITES(pb_enc_fixed64(&s, NULL, &dvalue), "\x00\x00\x00\xc0\x29\x8c\x67\xc1")) in main()
175 TEST(WRITES(pb_enc_bytes(&s, &BytesMessage_fields[0], &value), "\x05xyzzy")) in main()
177 TEST(WRITES(pb_enc_bytes(&s, &BytesMessage_fields[0], &value), "\x00")) in main()
186 TEST(WRITES(pb_enc_string(&s, &StringMessage_fields[0], &value), "\x05xyzzy")) in main()
188 TEST(WRITES(pb_enc_string(&s, &StringMessage_fields[0], &value), "\x00")) in main()
190 TEST(WRITES(pb_enc_string(&s, &StringMessage_fields[0], &value), "\x0Axxxxxxxxxx")) in main()
200 TEST(WRITES(pb_encode(&s, IntegerArray_fields, &msg), "\x0A\x05\x01\x02\x03\x04\x05")) in main()
203 TEST(WRITES(pb_encode(&s, IntegerArray_fields, &msg), "")) in main()
206 TEST(!pb_encode(&s, IntegerArray_fields, &msg)) in main()
216 TEST(WRITES(pb_encode(&s, FloatArray_fields, &msg), in main()
220 TEST(WRITES(pb_encode(&s, FloatArray_fields, &msg), "")) in main()
223 TEST(!pb_encode(&s, FloatArray_fields, &msg)) in main()
234 TEST((msg.data_count = 10) && pb_encode(&s, FloatArray_fields, &msg)) in main()
237 TEST((msg.data_count = 11) && !pb_encode(&s, FloatArray_fields, &msg)) in main()
248 TEST(WRITES(pb_encode(&s, CallbackArray_fields, &msg), "\x08\x55")) in main()
257 TEST(WRITES(pb_encode(&s, IntegerContainer_fields, &msg), in main()
267 TEST(WRITES(pb_encode(&s, BytesMessage_fields, &msg), in main()
271 TEST(!pb_encode(&s, BytesMessage_fields, &msg)) in main()
281 TEST(WRITES(pb_encode_delimited(&s, IntegerContainer_fields, &msg), in main()
290 TEST(pb_get_encoded_size(&size, IntegerContainer_fields, &msg) && in main()
305 TEST(WRITES(pb_encode(&s, CallbackContainer_fields, &msg), "\x0A\x02\x08\x55")) in main()
306 TEST(WRITES(pb_encode(&s, CallbackContainerContainer_fields, &msg2), in main()
315 TEST(!pb_encode(&s, CallbackContainer_fields, &msg)) in main()
317 TEST(!pb_encode(&s, CallbackContainerContainer_fields, &msg2)) in main()
329 TEST(pb_encode(&s, StringMessage_fields, &msg)); in main()
330 TEST(s.bytes_written == StringMessage_size); in main()