Lines Matching refs:tt_assert
78 tt_assert(buf->last == NULL); in evbuffer_validate_()
79 tt_assert(buf->total_len == 0); in evbuffer_validate_()
84 tt_assert(buf->last_with_datap); in evbuffer_validate_()
93 tt_assert(buf->last == chain); in evbuffer_validate_()
95 tt_assert(chain->buffer_len >= chain->misalign + chain->off); in evbuffer_validate_()
100 tt_assert(*buf->last_with_datap); in evbuffer_validate_()
105 tt_assert(chain->off == 0) in evbuffer_validate_()
106 tt_assert(chain == buf->first); in evbuffer_validate_()
107 tt_assert(buf->total_len == 0); in evbuffer_validate_()
111 tt_assert(chain->off == 0); in evbuffer_validate_()
115 tt_assert(buf->last_with_datap == &buf->first); in evbuffer_validate_()
117 tt_assert(found_last_with_datap); in evbuffer_validate_()
119 tt_assert(sum == buf->total_len); in evbuffer_validate_()
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()
193 tt_assert(evbuffer_get_length(evb) == 1); in test_evbuffer()
194 tt_assert(!memcmp((char*)EVBUFFER_DATA(evb), "1", 1)); in test_evbuffer()
201 tt_assert(evbuffer_get_length(evb_two) == 0); 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()
208 tt_assert(evbuffer_get_length(evb) == 7 + 512); in test_evbuffer()
211 tt_assert(tmp); in test_evbuffer()
212 tt_assert(!strncmp(tmp, "1/hello", 7)); in test_evbuffer()
213 tt_assert(!memcmp(tmp + 7, buffer, sizeof(buffer))); in test_evbuffer()
222 tt_assert(!strncmp(tmp, "elsesomething1/hello", 4 + 9 + 7)); in test_evbuffer()
238 tt_assert(evbuffer_get_length(evb_two) == 0); in test_evbuffer()
239 tt_assert(evbuffer_get_length(evb) == i * sizeof(buffer)); in test_evbuffer()
244 tt_assert(evbuffer_get_length(evb_two) == sz_tmp); in test_evbuffer()
245 tt_assert(evbuffer_get_length(evb) == sizeof(buffer) / 2); in test_evbuffer()
266 tt_assert(v[0].iov_len >= 10000); in test_evbuffer()
267 tt_assert(v[0].iov_base != NULL); in test_evbuffer()
279 tt_assert(evbuffer_get_length(evb) >= 10000); in test_evbuffer()
464 tt_assert(buf1); in test_evbuffer_remove_buffer_with_empty_front()
467 tt_assert(buf2); in test_evbuffer_remove_buffer_with_empty_front()
491 tt_assert(buf1); in test_evbuffer_remove_buffer_adjust_last_with_datap_with_empty()
494 tt_assert(buf2); in test_evbuffer_remove_buffer_adjust_last_with_datap_with_empty()
506 tt_assert(*(char *)(iovecs[0].iov_base) = 'b'); in test_evbuffer_remove_buffer_adjust_last_with_datap_with_empty()
507 tt_assert(iovecs[0].iov_len = 1); in test_evbuffer_remove_buffer_adjust_last_with_datap_with_empty()
615 tt_assert(v[0].iov_base != NULL); in test_evbuffer_reserve2()
630 tt_assert(cp + 512 == v[0].iov_base); in test_evbuffer_reserve2()
643 tt_assert(cp + 520 == v[0].iov_base); in test_evbuffer_reserve2()
645 tt_assert(v[1].iov_base); in test_evbuffer_reserve2()
646 tt_assert(v[1].iov_len >= 64); in test_evbuffer_reserve2()
660 tt_assert(cp + 521 == v[0].iov_base); in test_evbuffer_reserve2()
662 tt_assert(v[1].iov_base == cp2); in test_evbuffer_reserve2()
663 tt_assert(v[1].iov_len >= 64); in test_evbuffer_reserve2()
714 tt_assert(v[0].iov_len >= 128); in test_evbuffer_reserve_many()
729 tt_assert(v[0].iov_base != cp1); in test_evbuffer_reserve_many()
740 tt_assert(v[0].iov_base == cp1 + 1); in test_evbuffer_reserve_many()
742 tt_assert(v[0].iov_base == cp1); in test_evbuffer_reserve_many()
751 tt_assert(cp1 == v[0].iov_base); in test_evbuffer_reserve_many()
752 tt_assert(cp2 == v[1].iov_base); in test_evbuffer_reserve_many()
761 tt_assert(cp1 == v[0].iov_base); in test_evbuffer_reserve_many()
776 tt_assert(buf = evbuffer_new()); in test_evbuffer_reserve_with_empty()
803 tt_assert(buf); in test_evbuffer_reserve_invalid_last_with_datap()
843 tt_assert(w == 0); in test_evbuffer_expand()
844 tt_assert(u == 0); in test_evbuffer_expand()
845 tt_assert(a >= 20000); in test_evbuffer_expand()
846 tt_assert(buf->first); in test_evbuffer_expand()
847 tt_assert(buf->first == buf->last); in test_evbuffer_expand()
848 tt_assert(buf->first->off == 0); in test_evbuffer_expand()
849 tt_assert(buf->first->buffer_len >= 20000); in test_evbuffer_expand()
856 tt_assert(buf->first->buffer == buffer); in test_evbuffer_expand()
866 tt_assert(n < (int)sizeof(data)); in test_evbuffer_expand()
869 tt_assert(buf->first == buf->last); in test_evbuffer_expand()
870 tt_assert(buf->first->off == buf->first->buffer_len - 1); in test_evbuffer_expand()
872 tt_assert(1 == evbuffer_get_length(buf)); in test_evbuffer_expand()
873 tt_assert(buf->first->misalign > 0); in test_evbuffer_expand()
874 tt_assert(buf->first->off == 1); in test_evbuffer_expand()
876 tt_assert(evbuffer_expand(buf, 40) == 0); in test_evbuffer_expand()
877 tt_assert(buf->first == buf->last); in test_evbuffer_expand()
878 tt_assert(buf->first->off == 1); in test_evbuffer_expand()
879 tt_assert(buf->first->buffer == buffer); in test_evbuffer_expand()
880 tt_assert(buf->first->misalign == 0); in test_evbuffer_expand()
934 tt_assert(evbuffer_get_length(buf) == 3); in test_evbuffer_add1()
936 tt_assert(str[0] == '1'); in test_evbuffer_add1()
937 tt_assert(str[1] == '2'); in test_evbuffer_add1()
938 tt_assert(str[2] == '3'); in test_evbuffer_add1()
964 tt_assert(len == data_len+2); in test_evbuffer_add2()
966 tt_assert(str[len-3] == 'P'); in test_evbuffer_add2()
967 tt_assert(str[len-2] == '2'); in test_evbuffer_add2()
968 tt_assert(str[len-1] == '3'); in test_evbuffer_add2()
994 tt_assert(evbuffer_add_reference(src, data, strlen(data), in test_evbuffer_reference()
998 tt_assert(evbuffer_remove(src, v[0].iov_base, 10) != -1); in test_evbuffer_reference()
1008 tt_assert(evbuffer_remove(src, ((char*)(v[0].iov_base)) + 10, in test_evbuffer_reference()
1019 tt_assert(!memcmp(evbuffer_pullup(dst, strlen(data)), in test_evbuffer_reference()
1049 tt_assert(len == data_len+2); in test_evbuffer_reference2()
1051 tt_assert(str[len-3] == 'P'); in test_evbuffer_reference2()
1052 tt_assert(str[len-2] == '2'); in test_evbuffer_reference2()
1053 tt_assert(str[len-1] == '3'); in test_evbuffer_reference2()
1140 tt_assert(impl); in test_evbuffer_add_file()
1193 tt_assert(data); in test_evbuffer_add_file()
1198 tt_assert(data); in test_evbuffer_add_file()
1214 tt_assert(use_segment); /* Can't do this with add_file*/ in test_evbuffer_add_file()
1224 tt_assert(seg); in test_evbuffer_add_file()
1250 tt_assert(fd != -1); in test_evbuffer_add_file()
1253 tt_assert(evbuffer_add_file_segment(src, seg, in test_evbuffer_add_file()
1256 tt_assert(evbuffer_add_file(src, fd, starting_offset, in test_evbuffer_add_file()
1279 tt_assert(addfile_test_done_writing); in test_evbuffer_add_file()
1284 tt_assert(compare != NULL); in test_evbuffer_add_file()
1339 tt_assert(evb); in test_evbuffer_file_segment_add_cleanup_cb()
1342 tt_assert(seg); in test_evbuffer_file_segment_add_cleanup_cb()
1347 tt_assert(fd != -1); 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()
1362 tt_assert(file_segment_cleanup_cb_called_with == segptr); in test_evbuffer_file_segment_add_cleanup_cb()
1363 tt_assert(file_segment_cleanup_cb_called_with_flags == 0); in test_evbuffer_file_segment_add_cleanup_cb()
1364 tt_assert(file_segment_cleanup_cb_called_with_arg == (void*)arg); in test_evbuffer_file_segment_add_cleanup_cb()
1424 tt_assert(!cp); in test_evbuffer_readln()
1427 tt_assert(evbuffer_get_length(evb) == 0); in test_evbuffer_readln()
1457 tt_assert(!cp); in test_evbuffer_readln()
1475 tt_assert(!cp); in test_evbuffer_readln()
1483 tt_assert(evbuffer_get_length(evb) == 0); in test_evbuffer_readln()
1494 tt_assert(!cp); in test_evbuffer_readln()
1502 tt_assert(evbuffer_get_length(evb) == 0); in test_evbuffer_readln()
1521 tt_assert(!cp); in test_evbuffer_readln()
1584 tt_assert(!cp); in test_evbuffer_readln()
1593 tt_assert(evbuffer_get_length(evb) == 0); in test_evbuffer_readln()
1611 tt_assert(cp == NULL); in test_evbuffer_readln()
1675 tt_assert(evbuffer_ptr_set(buf, &ptr1, evbuffer_get_length(buf), EVBUFFER_PTR_SET) == 0); in test_evbuffer_search_eol()
1722 tt_assert( ((double)w)/a < .125); in test_evbuffer_iterative()
1740 tt_assert(buf); in test_evbuffer_find()
1768 tt_assert(p != NULL); in test_evbuffer_find()
1783 tt_assert(buf); in test_evbuffer_ptr_set()
1787 tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0); in test_evbuffer_ptr_set()
1788 tt_assert(pos.pos == 0); in test_evbuffer_ptr_set()
1789 tt_assert(evbuffer_ptr_set(buf, &pos, 1, EVBUFFER_PTR_ADD) == -1); in test_evbuffer_ptr_set()
1790 tt_assert(pos.pos == -1); in test_evbuffer_ptr_set()
1791 tt_assert(evbuffer_ptr_set(buf, &pos, 1, EVBUFFER_PTR_SET) == -1); in test_evbuffer_ptr_set()
1792 tt_assert(pos.pos == -1); in test_evbuffer_ptr_set()
1814 tt_assert(evbuffer_ptr_set(buf, &pos, 13000, EVBUFFER_PTR_SET) == -1); in test_evbuffer_ptr_set()
1815 tt_assert(pos.pos == -1); in test_evbuffer_ptr_set()
1816 tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0); in test_evbuffer_ptr_set()
1817 tt_assert(pos.pos == 0); in test_evbuffer_ptr_set()
1818 tt_assert(evbuffer_ptr_set(buf, &pos, 13000, EVBUFFER_PTR_ADD) == -1); in test_evbuffer_ptr_set()
1820 tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0); in test_evbuffer_ptr_set()
1821 tt_assert(pos.pos == 0); in test_evbuffer_ptr_set()
1822 tt_assert(evbuffer_ptr_set(buf, &pos, 10000, EVBUFFER_PTR_ADD) == 0); in test_evbuffer_ptr_set()
1823 tt_assert(pos.pos == 10000); in test_evbuffer_ptr_set()
1824 tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == 0); in test_evbuffer_ptr_set()
1825 tt_assert(pos.pos == 11000); in test_evbuffer_ptr_set()
1826 tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == 0); in test_evbuffer_ptr_set()
1827 tt_assert(pos.pos == 12000); in test_evbuffer_ptr_set()
1828 tt_assert(evbuffer_ptr_set(buf, &pos, 1000, EVBUFFER_PTR_ADD) == -1); in test_evbuffer_ptr_set()
1829 tt_assert(pos.pos == -1); in test_evbuffer_ptr_set()
1843 tt_assert(buf); in test_evbuffer_search()
1844 tt_assert(tmp); in test_evbuffer_search()
1848 tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0); in test_evbuffer_search()
1851 tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0); in test_evbuffer_search()
1854 tt_assert(evbuffer_ptr_set(buf, &pos, 0, EVBUFFER_PTR_SET) == 0); in test_evbuffer_search()
1902 tt_assert(evbuffer_ptr_set(buf, &end, 17, EVBUFFER_PTR_SET) == 0); in test_evbuffer_search()
1906 tt_assert(evbuffer_ptr_set(buf, &pos, 11, EVBUFFER_PTR_SET) == 0); in test_evbuffer_search()
1909 tt_assert(evbuffer_ptr_set(buf, &pos, 17, EVBUFFER_PTR_SET) == 0); in test_evbuffer_search()
1912 tt_assert(evbuffer_ptr_set(buf, &pos, 17, EVBUFFER_PTR_SET) == 0); in test_evbuffer_search()
1951 tt_assert(buf); in test_evbuffer_callbacks()
1952 tt_assert(buf_out1); in test_evbuffer_callbacks()
1953 tt_assert(buf_out2); in test_evbuffer_callbacks()
1973 tt_assert(-1 == evbuffer_remove_cb(buf, log_change_callback, NULL)); in test_evbuffer_callbacks()
1975 tt_assert(!evbuffer_remove_cb(buf, log_change_callback, buf_out2)); in test_evbuffer_callbacks()
1986 tt_assert(cb1 != NULL); in test_evbuffer_callbacks()
1988 tt_assert(cb2 != NULL); in test_evbuffer_callbacks()
2061 tt_assert(buf1); in test_evbuffer_add_reference()
2085 tt_assert(ref_done_cb_called_with == (void*)111); in test_evbuffer_add_reference()
2086 tt_assert(ref_done_cb_called_with_data == chunk1); in test_evbuffer_add_reference()
2087 tt_assert(ref_done_cb_called_with_len == len1); in test_evbuffer_add_reference()
2094 tt_assert(buf2); in test_evbuffer_add_reference()
2104 tt_assert(ref_done_cb_called_with == (void*)222); in test_evbuffer_add_reference()
2116 tt_assert(ref_done_cb_called_with == (void*)3333); in test_evbuffer_add_reference()
2137 tt_assert(buf1); in test_evbuffer_multicast()
2145 tt_assert(buf2); in test_evbuffer_multicast()
2205 tt_assert(buf1); in test_evbuffer_multicast_drain()
2213 tt_assert(buf2); in test_evbuffer_multicast_drain()
2250 tt_assert(buf1); in test_evbuffer_prepend()
2264 tt_assert(!memcmp(buf1->first->buffer+buf1->first->misalign, in test_evbuffer_prepend()
2276 tt_assert(buf2); in test_evbuffer_prepend()
2298 tt_assert(buf2); in test_evbuffer_prepend()
2324 tt_assert(buf); in test_evbuffer_empty_reference_prepend()
2332 tt_assert(!strncmp((char *)evbuffer_pullup(buf, -1), "foo", 3)); in test_evbuffer_empty_reference_prepend()
2345 tt_assert(buf1); in test_evbuffer_empty_reference_prepend_buffer()
2347 tt_assert(buf2); in test_evbuffer_empty_reference_prepend_buffer()
2357 tt_assert(!strncmp((char *)evbuffer_pullup(buf2, -1), "foo", 3)); in test_evbuffer_empty_reference_prepend_buffer()
2360 tt_assert(evbuffer_pullup(buf1, -1) == NULL); in test_evbuffer_empty_reference_prepend_buffer()
2416 tt_assert(!memcmp((v)->iov_base, (s), strlen(s))) in test_evbuffer_peek()
2443 tt_assert(v[1].iov_base == NULL); in test_evbuffer_peek()
2451 tt_assert(v[2].iov_base == NULL); in test_evbuffer_peek()
2457 tt_assert(v[0].iov_base == NULL); in test_evbuffer_peek()
2464 tt_assert(v[1].iov_base == NULL); in test_evbuffer_peek()
2474 tt_assert(v[16].iov_base == NULL); in test_evbuffer_peek()
2480 tt_assert(v[0].iov_base == NULL); in test_evbuffer_peek()
2484 tt_assert(v[0].iov_base == NULL); in test_evbuffer_peek()
2505 tt_assert(evbuffer_ptr_set(buf, &ptr, evbuffer_get_length(buf), EVBUFFER_PTR_SET) == 0); in test_evbuffer_peek()
2508 tt_assert(v[0].iov_base == NULL); in test_evbuffer_peek()
2551 tt_assert(tmp_buf); in test_evbuffer_freeze()
2597 tt_assert(evbuffer_get_length(tmp_buf)); in test_evbuffer_freeze()
2621 tt_assert(evbuffer_get_length(tmp_buf)); in test_evbuffer_freeze()
2675 tt_assert(buf); in test_evbuffer_add_iovec()
2693 tt_assert(strcmp(charbuf, data[i]) == 0); in test_evbuffer_add_iovec()
2696 tt_assert(evbuffer_get_length(buf) == 0); in test_evbuffer_add_iovec()
2719 tt_assert(buf); in test_evbuffer_copyout()