Lines Matching refs:s

44 s = pb_ostream_from_buffer(buffer, sizeof(buffer)), \
77 pb_ostream_t s; in main() local
80 TEST(WRITES(pb_encode_varint(&s, 0), "\0")); in main()
81 TEST(WRITES(pb_encode_varint(&s, 1), "\1")); in main()
82 TEST(WRITES(pb_encode_varint(&s, 0x7F), "\x7F")); in main()
83 TEST(WRITES(pb_encode_varint(&s, 0x80), "\x80\x01")); in main()
84 TEST(WRITES(pb_encode_varint(&s, UINT32_MAX), "\xFF\xFF\xFF\xFF\x0F")); in main()
85 TEST(WRITES(pb_encode_varint(&s, UINT64_MAX), "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01")); in main()
90 pb_ostream_t s; in main() local
93 TEST(WRITES(pb_encode_varint(&s, 0x00000000), "\x00")); in main()
94 TEST(WRITES(pb_encode_varint(&s, 0x00000001), "\x01")); in main()
95 TEST(WRITES(pb_encode_varint(&s, 0x0000007F), "\x7F")); in main()
96 TEST(WRITES(pb_encode_varint(&s, 0x00000080), "\x80\x01")); in main()
97 TEST(WRITES(pb_encode_varint(&s, 0x00000191), "\x91\x03")); in main()
98 TEST(WRITES(pb_encode_varint(&s, 0x00003FFF), "\xFF\x7F")); in main()
99 TEST(WRITES(pb_encode_varint(&s, 0x00004000), "\x80\x80\x01")); in main()
100 TEST(WRITES(pb_encode_varint(&s, 0x0000D111), "\x91\xA2\x03")); in main()
101 TEST(WRITES(pb_encode_varint(&s, 0x001FFFFF), "\xFF\xFF\x7F")); in main()
102 TEST(WRITES(pb_encode_varint(&s, 0x00200000), "\x80\x80\x80\x01")); in main()
103 TEST(WRITES(pb_encode_varint(&s, 0x00711111), "\x91\xA2\xC4\x03")); in main()
104 TEST(WRITES(pb_encode_varint(&s, 0x0FFFFFFF), "\xFF\xFF\xFF\x7F")); in main()
105 TEST(WRITES(pb_encode_varint(&s, 0x10000000), "\x80\x80\x80\x80\x01")); in main()
106 TEST(WRITES(pb_encode_varint(&s, 0x31111111), "\x91\xA2\xC4\x88\x03")); in main()
107 TEST(WRITES(pb_encode_varint(&s, UINT32_MAX), "\xFF\xFF\xFF\xFF\x0F")); in main()
112 pb_ostream_t s; in main() local
115 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x00000000), "\x00")); in main()
116 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0xFFFFFFFF), "\x01")); in main()
117 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x0000003F), "\x7E")); in main()
118 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0xFFFFFFC0), "\x7F")); in main()
119 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x00000040), "\x80\x01")); in main()
120 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x00001FFF), "\xFE\x7F")); in main()
121 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0xFFFFE000), "\xFF\x7F")); in main()
122 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x00002000), "\x80\x80\x01")); in main()
123 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x000FFFFF), "\xFE\xFF\x7F")); in main()
124 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0xFFF00000), "\xFF\xFF\x7F")); in main()
125 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x00100000), "\x80\x80\x80\x01")); in main()
126 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x07FFFFFF), "\xFE\xFF\xFF\x7F")); in main()
127 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0xF8000000), "\xFF\xFF\xFF\x7F")); in main()
128 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x08000000), "\x80\x80\x80\x80\x01")); in main()
129 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x7FFFFFFF), "\xFE\xFF\xFF\xFF\x0F")); in main()
130 TEST(WRITES(pb_encode_svarint(&s, (int32_t)0x80000000), "\xFF\xFF\xFF\xFF\x0F")); in main()
135 pb_ostream_t s; in main() local
138 TEST(WRITES(pb_encode_tag(&s, PB_WT_STRING, 5), "\x2A")); in main()
139 TEST(WRITES(pb_encode_tag(&s, PB_WT_VARINT, 99), "\x98\x06")); in main()
144 pb_ostream_t s; in main() local
150 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x50")); in main()
153 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x51")); in main()
156 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x52")); in main()
159 TEST(WRITES(pb_encode_tag_for_field(&s, &field), "\x55")); in main()
164 pb_ostream_t s; in main() local
167 TEST(WRITES(pb_encode_string(&s, (const uint8_t*)"abcd", 4), "\x04""abcd")); in main()
168 TEST(WRITES(pb_encode_string(&s, (const uint8_t*)"abcd\x00", 5), "\x05""abcd\x00")); in main()
169 TEST(WRITES(pb_encode_string(&s, (const uint8_t*)"", 0), "\x00")); in main()
174 pb_ostream_t s; in main() local
186 TEST(WRITES(pb_enc_varint(&s, &field), "\x01")); in main()
191 TEST(WRITES(pb_enc_varint(&s, &field), "\xfe\xff\xff\xff\x0f")); in main()
196 TEST(WRITES(pb_enc_varint(&s, &field), "\xff\xff\xff\xff\x0f")); in main()
201 TEST(WRITES(pb_enc_varint(&s, &field), "\xFE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01")); in main()
206 TEST(WRITES(pb_enc_varint(&s, &field), "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01")); in main()
211 pb_ostream_t s; in main() local
221 TEST(WRITES(pb_enc_fixed(&s, &field), "\x00\x00\x00\x00")) in main()
223 TEST(WRITES(pb_enc_fixed(&s, &field), "\x00\x00\xc6\x42")) in main()
225 TEST(WRITES(pb_enc_fixed(&s, &field), "\x4e\x61\x3c\xcb")) in main()
232 TEST(WRITES(pb_enc_fixed(&s, &field), "\x00\x00\x00\x00\x00\x00\x00\x00")) in main()
234 TEST(WRITES(pb_enc_fixed(&s, &field), "\x00\x00\x00\x00\x00\xc0\x58\x40")) in main()
236 TEST(WRITES(pb_enc_fixed(&s, &field), "\x00\x00\x00\xc0\x29\x8c\x67\xc1")) in main()
241 pb_ostream_t s; in main() local
247 TEST(WRITES(pb_enc_bytes(&s, &field), "\x05xyzzy")) in main()
249 TEST(WRITES(pb_enc_bytes(&s, &field), "\x00")) in main()
254 pb_ostream_t s; in main() local
260 TEST(WRITES(pb_enc_string(&s, &field), "\x05xyzzy")) in main()
262 TEST(WRITES(pb_enc_string(&s, &field), "\x00")) in main()
265 TEST(WRITES(pb_enc_string(&s, &field), "\x0Axxxxxxxxxx")) in main()
270 pb_ostream_t s; in main() local
275 TEST(WRITES(pb_encode(&s, IntegerArray_fields, &msg), "\x0A\x05\x01\x02\x03\x04\x05")) in main()
278 TEST(WRITES(pb_encode(&s, IntegerArray_fields, &msg), "")) in main()
281 TEST(!pb_encode(&s, IntegerArray_fields, &msg)) in main()
286 pb_ostream_t s; in main() local
291 TEST(WRITES(pb_encode(&s, FloatArray_fields, &msg), in main()
295 TEST(WRITES(pb_encode(&s, FloatArray_fields, &msg), "")) in main()
298 TEST(!pb_encode(&s, FloatArray_fields, &msg)) in main()
303 pb_ostream_t s; in main() local
308 s = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
309 TEST((msg.data_count = 10) && pb_encode(&s, FloatArray_fields, &msg)) in main()
311 s = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
312 TEST((msg.data_count = 11) && !pb_encode(&s, FloatArray_fields, &msg)) in main()
317 pb_ostream_t s; in main() local
323 TEST(WRITES(pb_encode(&s, CallbackArray_fields, &msg), "\x08\x55")) in main()
328 pb_ostream_t s; in main() local
332 TEST(WRITES(pb_encode(&s, IntegerContainer_fields, &msg), in main()
338 pb_ostream_t s; in main() local
342 TEST(WRITES(pb_encode(&s, BytesMessage_fields, &msg), in main()
346 TEST(!pb_encode(&s, BytesMessage_fields, &msg)) in main()
352 pb_ostream_t s; in main() local
356 TEST(WRITES(pb_encode_delimited(&s, IntegerContainer_fields, &msg), in main()
371 pb_ostream_t s; in main() local
380 TEST(WRITES(pb_encode(&s, CallbackContainer_fields, &msg), "\x0A\x02\x08\x55")) in main()
381 TEST(WRITES(pb_encode(&s, CallbackContainerContainer_fields, &msg2), in main()
390 TEST(!pb_encode(&s, CallbackContainer_fields, &msg)) in main()
392 TEST(!pb_encode(&s, CallbackContainerContainer_fields, &msg2)) in main()
397 pb_ostream_t s; in main() local
400 s = pb_ostream_from_buffer(buffer, sizeof(buffer)); in main()
404 TEST(pb_encode(&s, StringMessage_fields, &msg)); in main()
405 TEST(s.bytes_written == StringMessage_size); in main()
410 pb_ostream_t s; in main() local
419 TEST(WRITES(pb_encode(&s, StringPointerContainer_fields, &msg), "\x0a\x00")) in main()
422 TEST(WRITES(pb_encode(&s, StringPointerContainer_fields, &msg), "\x0a\x01Z")) in main()