]> granicus.if.org Git - libevent/commitdiff
Add failing test for evbuffer_search_range.
authorNir Soffer <nirsof@gmail.com>
Tue, 7 Jun 2011 00:15:51 +0000 (03:15 +0300)
committerNick Mathewson <nickm@torproject.org>
Mon, 13 Jun 2011 20:48:02 +0000 (16:48 -0400)
test/regress_buffer.c

index 9c4b47c7a11f6f1354f6135b628027876e2f2540..2e5efeb150642dbf5b447abe5ff7b7b2956680bc 100644 (file)
@@ -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)