From 3ba10add8ec162fbb6a81464b7aabf6ff45acead Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 5 Mar 2015 19:54:15 +0000 Subject: skiplist: keep tests in sync with 1.5.x and 1.6.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1664467 13f79535-47bb-0310-9956-ffa450edef68 --- test/testskiplist.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/testskiplist.c b/test/testskiplist.c index 29796468e..811c75c75 100644 --- a/test/testskiplist.c +++ b/test/testskiplist.c @@ -244,7 +244,7 @@ static void skiplist_random_loop(abts_case *tc, void *data) static void add_int_to_skiplist(apr_skiplist *list, int n){ int* a = apr_skiplist_alloc(list, sizeof(int)); *a = n; - apr_skiplist_addne(list, a); + apr_skiplist_insert(list, a); } static int comp(void *a, void *b){ @@ -296,6 +296,23 @@ static void skiplist_test(abts_case *tc, void *data) { val = apr_skiplist_pop(list, NULL); ABTS_PTR_EQUAL(tc, val, NULL); + add_int_to_skiplist(list, 42); + add_int_to_skiplist(list, 1); + add_int_to_skiplist(list, 142); + add_int_to_skiplist(list, 42); + val = apr_skiplist_peek(list); + ABTS_INT_EQUAL(tc, *val, 1); + val = apr_skiplist_pop(list, NULL); + ABTS_INT_EQUAL(tc, *val, 1); + val = apr_skiplist_peek(list); + ABTS_INT_EQUAL(tc, *val, 42); + val = apr_skiplist_pop(list, NULL); + ABTS_INT_EQUAL(tc, *val, 42); + val = apr_skiplist_pop(list, NULL); + ABTS_INT_EQUAL(tc, *val, 42); + val = apr_skiplist_peek(list); + ABTS_INT_EQUAL(tc, *val, 142); + apr_pool_clear(ptmp); } -- cgit v1.2.1