diff options
author | Yann Ylavic <ylavic@apache.org> | 2015-03-05 19:54:15 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2015-03-05 19:54:15 +0000 |
commit | 3ba10add8ec162fbb6a81464b7aabf6ff45acead (patch) | |
tree | dc3c3c5592f3e0bd64c165ed7e6722a85e479ada /test | |
parent | c44e73dc4689bb9dba164512fc0e01c7fcfb8f5e (diff) | |
download | apr-3ba10add8ec162fbb6a81464b7aabf6ff45acead.tar.gz |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/testskiplist.c | 19 |
1 files changed, 18 insertions, 1 deletions
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); } |