Lines Matching full:evb

176 	struct evbuffer *evb = evbuffer_new();  in test_evbuffer()  local
181 evbuffer_validate(evb); in test_evbuffer()
182 evbuffer_add_printf(evb, "%s/%d", "hello", 1); in test_evbuffer()
183 evbuffer_validate(evb); in test_evbuffer()
185 tt_assert(evbuffer_get_length(evb) == 7); in test_evbuffer()
186 tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "hello/1", 1)); in test_evbuffer()
188 evbuffer_add_buffer(evb, evb_two); in test_evbuffer()
189 evbuffer_validate(evb); in test_evbuffer()
191 evbuffer_drain(evb, strlen("hello/")); in test_evbuffer()
192 evbuffer_validate(evb); in test_evbuffer()
193 tt_assert(evbuffer_get_length(evb) == 1); in test_evbuffer()
194 tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "1", 1)); in test_evbuffer()
197 evbuffer_validate(evb); in test_evbuffer()
198 evbuffer_add_buffer(evb, evb_two); in test_evbuffer()
199 evbuffer_validate(evb); in test_evbuffer()
202 tt_assert(evbuffer_get_length(evb) == 7); in test_evbuffer()
203 tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "1/hello", 7)); in test_evbuffer()
206 evbuffer_add(evb, buffer, sizeof(buffer)); in test_evbuffer()
207 evbuffer_validate(evb); in test_evbuffer()
208 tt_assert(evbuffer_get_length(evb) == 7 + 512); in test_evbuffer()
210 tmp = (char *)evbuffer_pullup(evb, 7 + 512); in test_evbuffer()
214 evbuffer_validate(evb); in test_evbuffer()
216 evbuffer_prepend(evb, "something", 9); in test_evbuffer()
217 evbuffer_validate(evb); in test_evbuffer()
218 evbuffer_prepend(evb, "else", 4); in test_evbuffer()
219 evbuffer_validate(evb); in test_evbuffer()
221 tmp = (char *)evbuffer_pullup(evb, 4 + 9 + 7); in test_evbuffer()
223 evbuffer_validate(evb); in test_evbuffer()
225 evbuffer_drain(evb, -1); in test_evbuffer()
226 evbuffer_validate(evb); in test_evbuffer()
228 evbuffer_validate(evb); in test_evbuffer()
233 evbuffer_add_buffer(evb, evb_two); in test_evbuffer()
234 evbuffer_validate(evb); in test_evbuffer()
239 tt_assert(evbuffer_get_length(evb) == i * sizeof(buffer)); in test_evbuffer()
243 evbuffer_remove_buffer(evb, evb_two, sz_tmp); in test_evbuffer()
245 tt_assert(evbuffer_get_length(evb) == sizeof(buffer) / 2); in test_evbuffer()
246 evbuffer_validate(evb); in test_evbuffer()
249 evb, -1), buffer, sizeof(buffer) / 2) != 0 || in test_evbuffer()
254 evbuffer_validate(evb); in test_evbuffer()
264 r = evbuffer_reserve_space(evb, 10000, v, 1); in test_evbuffer()
269 evbuffer_validate(evb); in test_evbuffer()
274 evbuffer_validate(evb); in test_evbuffer()
276 tt_int_op(evbuffer_commit_space(evb, v, 1), ==, 0); in test_evbuffer()
277 evbuffer_validate(evb); in test_evbuffer()
279 tt_assert(evbuffer_get_length(evb) >= 10000); in test_evbuffer()
281 evbuffer_drain(evb, j * 5000); in test_evbuffer()
282 evbuffer_validate(evb); in test_evbuffer()
287 evbuffer_free(evb); in test_evbuffer()
1331 struct evbuffer *evb = NULL; in test_evbuffer_file_segment_add_cleanup_cb() local
1338 evb = evbuffer_new(); in test_evbuffer_file_segment_add_cleanup_cb()
1339 tt_assert(evb); in test_evbuffer_file_segment_add_cleanup_cb()
1349 tt_assert(evbuffer_add_file_segment(evb, seg, 0, -1)!=-1); in test_evbuffer_file_segment_add_cleanup_cb()
1351 evbuffer_validate(evb); in test_evbuffer_file_segment_add_cleanup_cb()
1358 evbuffer_free(evb); in test_evbuffer_file_segment_add_cleanup_cb()
1359 evb = NULL; /* pevent double-free */ in test_evbuffer_file_segment_add_cleanup_cb()
1367 if (evb) in test_evbuffer_file_segment_add_cleanup_cb()
1368 evbuffer_free(evb); in test_evbuffer_file_segment_add_cleanup_cb()
1389 struct evbuffer *evb = evbuffer_new(); in test_evbuffer_readln() local
1404 evbuffer_add(evb, s, strlen(s)+2); in test_evbuffer_readln()
1405 evbuffer_validate(evb); in test_evbuffer_readln()
1406 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY); in test_evbuffer_readln()
1409 evbuffer_validate(evb); in test_evbuffer_readln()
1410 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY); in test_evbuffer_readln()
1413 tt_uint_op(evbuffer_get_length(evb), ==, 0); in test_evbuffer_readln()
1414 evbuffer_validate(evb); in test_evbuffer_readln()
1416 evbuffer_add(evb, s, strlen(s)); in test_evbuffer_readln()
1418 evbuffer_validate(evb); in test_evbuffer_readln()
1419 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY); in test_evbuffer_readln()
1422 evbuffer_validate(evb); in test_evbuffer_readln()
1423 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_ANY); in test_evbuffer_readln()
1425 evbuffer_validate(evb); in test_evbuffer_readln()
1426 evbuffer_drain(evb, evbuffer_get_length(evb)); in test_evbuffer_readln()
1427 tt_assert(evbuffer_get_length(evb) == 0); in test_evbuffer_readln()
1428 evbuffer_validate(evb); in test_evbuffer_readln()
1432 evbuffer_add(evb, s, strlen(s)); in test_evbuffer_readln()
1433 evbuffer_validate(evb); in test_evbuffer_readln()
1434 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF); in test_evbuffer_readln()
1437 evbuffer_validate(evb); in test_evbuffer_readln()
1439 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF); in test_evbuffer_readln()
1442 evbuffer_validate(evb); in test_evbuffer_readln()
1444 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF); in test_evbuffer_readln()
1447 evbuffer_validate(evb); in test_evbuffer_readln()
1449 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF); in test_evbuffer_readln()
1452 evbuffer_validate(evb); in test_evbuffer_readln()
1453 evbuffer_add(evb, s, 1); in test_evbuffer_readln()
1454 evbuffer_validate(evb); in test_evbuffer_readln()
1456 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF); in test_evbuffer_readln()
1458 evbuffer_validate(evb); in test_evbuffer_readln()
1462 evbuffer_add(evb, s, strlen(s)); in test_evbuffer_readln()
1463 evbuffer_validate(evb); in test_evbuffer_readln()
1464 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1467 evbuffer_validate(evb); in test_evbuffer_readln()
1469 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1472 evbuffer_validate(evb); in test_evbuffer_readln()
1474 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1476 evbuffer_validate(evb); in test_evbuffer_readln()
1477 evbuffer_add(evb, "\n", 1); in test_evbuffer_readln()
1478 evbuffer_validate(evb); in test_evbuffer_readln()
1480 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1483 tt_assert(evbuffer_get_length(evb) == 0); in test_evbuffer_readln()
1484 evbuffer_validate(evb); in test_evbuffer_readln()
1487 evbuffer_add(evb, s, strlen(s)); in test_evbuffer_readln()
1488 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1491 evbuffer_validate(evb); in test_evbuffer_readln()
1493 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1495 evbuffer_validate(evb); in test_evbuffer_readln()
1497 evbuffer_add(evb, "\r\n", 2); in test_evbuffer_readln()
1498 evbuffer_validate(evb); in test_evbuffer_readln()
1499 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1502 tt_assert(evbuffer_get_length(evb) == 0); in test_evbuffer_readln()
1503 evbuffer_validate(evb); in test_evbuffer_readln()
1507 evbuffer_add(evb, s, strlen(s)); in test_evbuffer_readln()
1508 evbuffer_validate(evb); in test_evbuffer_readln()
1510 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF); in test_evbuffer_readln()
1513 evbuffer_validate(evb); in test_evbuffer_readln()
1515 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF); in test_evbuffer_readln()
1518 evbuffer_validate(evb); in test_evbuffer_readln()
1520 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF); in test_evbuffer_readln()
1523 evbuffer_add(evb, "\n", 1); in test_evbuffer_readln()
1524 evbuffer_validate(evb); in test_evbuffer_readln()
1525 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF); in test_evbuffer_readln()
1528 evbuffer_validate(evb); in test_evbuffer_readln()
1531 tt_int_op(evbuffer_get_length(evb), ==, 0); in test_evbuffer_readln()
1538 evbuffer_add(evb, x, sizeof(x)-1); in test_evbuffer_readln()
1540 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL); in test_evbuffer_readln()
1543 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL); in test_evbuffer_readln()
1546 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL); in test_evbuffer_readln()
1549 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL); in test_evbuffer_readln()
1552 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_NUL); in test_evbuffer_readln()
1554 evbuffer_drain(evb, -1); in test_evbuffer_readln()
1559 evbuffer_validate(evb); in test_evbuffer_readln()
1560 evbuffer_add_buffer(evb, evb_tmp); in test_evbuffer_readln()
1561 evbuffer_validate(evb); in test_evbuffer_readln()
1564 evbuffer_validate(evb); in test_evbuffer_readln()
1565 evbuffer_add_buffer(evb, evb_tmp); in test_evbuffer_readln()
1566 evbuffer_validate(evb); in test_evbuffer_readln()
1569 evbuffer_validate(evb); in test_evbuffer_readln()
1570 evbuffer_add_buffer(evb, evb_tmp); in test_evbuffer_readln()
1571 evbuffer_validate(evb); in test_evbuffer_readln()
1573 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1576 evbuffer_validate(evb); in test_evbuffer_readln()
1578 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1581 evbuffer_validate(evb); in test_evbuffer_readln()
1583 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1586 evbuffer_validate(evb); in test_evbuffer_readln()
1587 evbuffer_add(evb, "\n", 1); in test_evbuffer_readln()
1588 evbuffer_validate(evb); in test_evbuffer_readln()
1589 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_CRLF_STRICT); in test_evbuffer_readln()
1592 evbuffer_validate(evb); in test_evbuffer_readln()
1593 tt_assert(evbuffer_get_length(evb) == 0); in test_evbuffer_readln()
1598 evbuffer_validate(evb); in test_evbuffer_readln()
1599 evbuffer_add_buffer(evb, evb_tmp); in test_evbuffer_readln()
1600 evbuffer_validate(evb); in test_evbuffer_readln()
1602 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF); in test_evbuffer_readln()
1605 evbuffer_validate(evb); in test_evbuffer_readln()
1610 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF); in test_evbuffer_readln()
1612 evbuffer_validate(evb); in test_evbuffer_readln()
1617 cp = evbuffer_readln(evb, &sz, EVBUFFER_EOL_LF); in test_evbuffer_readln()
1620 evbuffer_validate(evb); in test_evbuffer_readln()
1623 evbuffer_free(evb); in test_evbuffer_readln()