From: Nir Soffer Date: Tue, 7 Jun 2011 00:15:51 +0000 (+0300) Subject: Add failing test for evbuffer_search_range. X-Git-Tag: release-2.1.1-alpha~237^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e2615421d8d626f08022d92269fd65632b4ec41;p=libevent Add failing test for evbuffer_search_range. --- diff --git a/test/regress_buffer.c b/test/regress_buffer.c index 9c4b47c7..2e5efeb1 100644 --- a/test/regress_buffer.c +++ b/test/regress_buffer.c @@ -1280,6 +1280,10 @@ test_evbuffer_search(void *ptr) pos = evbuffer_search_range(buf, "ack", 3, NULL, &end); tt_int_op(pos.pos, ==, -1); + /* Set "end" to the last byte in the buffer. */ + evbuffer_ptr_set(buf, &end, 17, EVBUFFER_PTR_SET); + pos = evbuffer_search_range(buf, "attack", 6, NULL, &end); + tt_int_op(pos.pos, ==, 11); end: if (buf)