Home | History | Annotate | Download | only in unittests

Lines Matching refs:buffer

46   leb128::ByteType buffer[2];
50 result = buffer;
52 ASSERT_EQ(buffer[0], 2);
53 ASSERT_EQ(result, buffer + 1);
56 result = buffer;
58 ASSERT_EQ(buffer[0], 127);
59 ASSERT_EQ(result, buffer + 1);
62 result = buffer;
64 ASSERT_EQ(buffer[0], 0 + 0x80);
65 ASSERT_EQ(buffer[1], 1);
66 ASSERT_EQ(result, buffer + 2);
69 result = buffer;
71 ASSERT_EQ(buffer[0], 1 + 0x80);
72 ASSERT_EQ(buffer[1], 1);
73 ASSERT_EQ(result, buffer + 2);
76 result = buffer;
78 ASSERT_EQ(buffer[0], 2 + 0x80);
79 ASSERT_EQ(buffer[1], 1);
80 ASSERT_EQ(result, buffer + 2);
83 result = buffer;
85 ASSERT_EQ(buffer[0], 57 + 0x80);
86 ASSERT_EQ(buffer[1], 100);
87 ASSERT_EQ(result, buffer + 2);
92 leb128::ByteType buffer[2];
96 result = buffer;
98 ASSERT_EQ(buffer[0], 2);
99 ASSERT_EQ(result, buffer + 1);
102 result = buffer;
104 ASSERT_EQ(buffer[0], 127);
105 ASSERT_EQ(result, buffer + 1);
108 result = buffer;
110 ASSERT_EQ(buffer[0], 0 + 0x80);
111 ASSERT_EQ(buffer[1], 1);
112 ASSERT_EQ(result, buffer + 2);
115 result = buffer;
117 ASSERT_EQ(buffer[0], 1 + 0x80);
118 ASSERT_EQ(buffer[1], 1);
119 ASSERT_EQ(result, buffer + 2);
122 result = buffer;
124 ASSERT_EQ(buffer[0], 2 + 0x80);
125 ASSERT_EQ(buffer[1], 1);
126 ASSERT_EQ(result, buffer + 2);
129 result = buffer;
131 ASSERT_EQ(buffer[0], 57 + 0x80);
132 ASSERT_EQ(buffer[1], 100);
133 ASSERT_EQ(result, buffer + 2);
138 leb128::ByteType buffer[2];
142 result = buffer;
144 ASSERT_EQ(buffer[0], 2);
145 ASSERT_EQ(result, buffer + 1);
148 result = buffer;
150 ASSERT_EQ(buffer[0], 0x7e);
151 ASSERT_EQ(result, buffer + 1);
154 result = buffer;
156 ASSERT_EQ(buffer[0], 127 + 0x80);
157 ASSERT_EQ(buffer[1], 0);
158 ASSERT_EQ(result, buffer + 2);
161 result = buffer;
163 ASSERT_EQ(buffer[0], 1 + 0x80);
164 ASSERT_EQ(buffer[1], 0x7f);
165 ASSERT_EQ(result, buffer + 2);
168 result = buffer;
170 ASSERT_EQ(buffer[0], 0 + 0x80);
171 ASSERT_EQ(buffer[1], 1);
172 ASSERT_EQ(result, buffer + 2);
175 result = buffer;
177 ASSERT_EQ(buffer[0], 0 + 0x80);
178 ASSERT_EQ(buffer[1], 0x7f);
179 ASSERT_EQ(result, buffer + 2);
182 result = buffer;
184 ASSERT_EQ(buffer[0], 1 + 0x80);
185 ASSERT_EQ(buffer[1], 1);
186 ASSERT_EQ(result, buffer + 2);
189 result = buffer;
191 ASSERT_EQ(buffer[0], 0x7f + 0x80);
192 ASSERT_EQ(buffer[1], 0x7e);
193 ASSERT_EQ(result, buffer + 2);
198 leb128::ByteType buffer[2];
201 buffer[0] = 2;
202 buffer[1] = 0;
203 ASSERT_TRUE(leb128::decode<uint64_t>(buffer, size) == 2);
206 buffer[0] = 127;
207 buffer[1] = 0;
208 ASSERT_TRUE(leb128::decode<uint64_t>(buffer, size) == 127);
211 buffer[0] = 0 + 0x80;
212 buffer[1] = 1;
213 ASSERT_TRUE(leb128::decode<uint64_t>(buffer, size) == 128);
216 buffer[0] = 1 + 0x80;
217 buffer[1] = 1;
218 ASSERT_TRUE(leb128::decode<uint64_t>(buffer, size) == 129);
221 buffer[0] = 2 + 0x80;
222 buffer[1] = 1;
223 ASSERT_TRUE(leb128::decode<uint64_t>(buffer, size) == 130);
226 buffer[0] = 57 + 0x80;
227 buffer[1] = 100;
228 ASSERT_TRUE(leb128::decode<uint64_t>(buffer, size) == 12857);
234 leb128::ByteType buffer[2];
237 buffer[0] = 2;
238 buffer[1] = 0;
239 ASSERT_EQ(leb128::decode<int64_t>(buffer, size), 2);
242 buffer[0] = 0x7e;
243 buffer[1] = 0;
244 ASSERT_EQ(leb128::decode<int64_t>(buffer, size), -2);
247 buffer[0] = 127 + 0x80;
248 buffer[1] = 0;
249 ASSERT_EQ(leb128::decode<int64_t>(buffer, size), 127);
252 buffer[0] = 1 + 0x80;
253 buffer[1] = 0x7f;
254 ASSERT_EQ(leb128::decode<int64_t>(buffer, size), -127);
257 buffer[0] = 0 + 0x80;
258 buffer[1] = 1;
259 ASSERT_EQ(leb128::decode<int64_t>(buffer, size), 128);
262 buffer[0] = 0 + 0x80;
263 buffer[1] = 0x7f;
264 ASSERT_EQ(leb128::decode<int64_t>(buffer, size), -128);
267 buffer[0] = 1 + 0x80;
268 buffer[1] = 1;
269 ASSERT_EQ(leb128::decode<int64_t>(buffer, size), 129);
272 buffer[0] = 0x7f + 0x80;
273 buffer[1] = 0x7e;
274 ASSERT_EQ(leb128::decode<int64_t>(buffer, size), -129);
300 leb128::ByteType buffer[5];
304 result = buffer;
306 ASSERT_EQ(buffer[0], 0);
307 ASSERT_EQ(result, buffer + 1);
310 result = buffer;
312 ASSERT_EQ(buffer[0], 0);
313 ASSERT_EQ(result, buffer + 1);
316 result = buffer;
318 ASSERT_EQ(buffer[0], 1);
319 ASSERT_EQ(result, buffer + 1);
322 result = buffer;
324 ASSERT_EQ(buffer[0], 1);
325 ASSERT_EQ(result, buffer + 1);
328 result = buffer;
330 ASSERT_EQ(buffer[0], 0x80);
331 ASSERT_EQ(buffer[1], 0x7f);
332 ASSERT_EQ(result, buffer + 2);
335 result = buffer;
337 ASSERT_EQ(buffer[0], 0x80);
338 ASSERT_EQ(buffer[1], 0x7f);
339 ASSERT_EQ(result, buffer + 2);
342 result = buffer;
344 ASSERT_EQ(buffer[0], 0xb4);
345 ASSERT_EQ(buffer[1], 0x07);
346 ASSERT_EQ(result, buffer + 2);
349 result = buffer;
351 ASSERT_EQ(buffer[0], 0xb4);
352 ASSERT_EQ(buffer[1], 0x07);
353 ASSERT_EQ(result, buffer + 2);
356 result = buffer;
358 ASSERT_EQ(buffer[0], 0x8c);
359 ASSERT_EQ(buffer[1], 0x08);
360 ASSERT_EQ(result, buffer + 2);
363 result = buffer;
365 ASSERT_EQ(buffer[0], 0x8c);
366 ASSERT_EQ(buffer[1], 0x08);
367 ASSERT_EQ(result, buffer + 2);
370 result = buffer;
372 ASSERT_EQ(buffer[0], 0xff);
373 ASSERT_EQ(buffer[1], 0xff);
374 ASSERT_EQ(buffer[2], 0xff);
375 ASSERT_EQ(buffer[3], 0xff);
376 ASSERT_EQ(buffer[4], 0xf);
377 ASSERT_EQ(result, buffer + 5);
380 result = buffer;
382 ASSERT_EQ(buffer[0], 0xff);
383 ASSERT_EQ(buffer[1], 0xff);
384 ASSERT_EQ(buffer[2], 0xff);
385 ASSERT_EQ(buffer[3], 0xff);
386 ASSERT_EQ(buffer[4], 0xf);
387 ASSERT_EQ(result, buffer + 5);
417 leb128::ByteType buffer[5];
421 result = buffer;
423 ASSERT_EQ(buffer[0], 0);
424 ASSERT_EQ(result, buffer + 1);
427 result = buffer;
429 ASSERT_EQ(buffer[0], 0);
430 ASSERT_EQ(result, buffer + 1);
433 result = buffer;
435 ASSERT_EQ(buffer[0], 1);
436 ASSERT_EQ(result, buffer + 1);
439 result = buffer;
441 ASSERT_EQ(buffer[0], 1);
442 ASSERT_EQ(result, buffer + 1);
445 result = buffer;
447 ASSERT_EQ(buffer[0], 0x7f);
448 ASSERT_EQ(result, buffer + 1);
451 result = buffer;
453 ASSERT_EQ(buffer[0], 0x7f);
454 ASSERT_EQ(result, buffer + 1);
459 leb128::ByteType buffer[9];
469 result = buffer;
471 ASSERT_EQ(result, buffer + encode_size);
472 ASSERT_EQ(leb128::decode<uint64_t>(buffer, decode_size), value);
476 result = buffer;
478 ASSERT_EQ(result, buffer + encode_size);
479 ASSERT_EQ(leb128::decode<uint64_t>(buffer, decode_size), value2);
483 result = buffer;
485 ASSERT_EQ(result, buffer + encode_size);
486 ASSERT_EQ(leb128::decode<int64_t>(buffer, decode_size), value3);
490 result = buffer;
492 ASSERT_EQ(result, buffer + encode_size);
493 ASSERT_EQ(leb128::decode<int64_t>(buffer, decode_size), -value3);
499 leb128::ByteType buffer[5];
503 result = buffer;
505 ASSERT_EQ(result, buffer + 3);
506 ASSERT_EQ(buffer[0], 0xd4);
507 ASSERT_EQ(buffer[1], 0xb6);
508 ASSERT_EQ(buffer[2], 0x9);
510 ASSERT_TRUE(leb128::decode<uint64_t>(buffer, size) == 154452);
515 char buffer[5];
519 result = buffer;
521 ASSERT_EQ(result, buffer + 3);
522 ASSERT_EQ(buffer[0], '\xd4');
523 ASSERT_EQ(buffer[1], '\xb6');
524 ASSERT_EQ(buffer[2], '\x09');
526 ASSERT_TRUE(leb128::decode<uint64_t>(buffer, size) == 154452);
529 const char *p = buffer;
531 ASSERT_TRUE(p == (buffer + 3));