apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1664467 - /apr/apr/trunk/test/testskiplist.c
Date Thu, 05 Mar 2015 19:54:15 GMT
Author: ylavic
Date: Thu Mar  5 19:54:15 2015
New Revision: 1664467

URL: http://svn.apache.org/r1664467
Log:
skiplist: keep tests in sync with 1.5.x and 1.6.x.

Modified:
    apr/apr/trunk/test/testskiplist.c

Modified: apr/apr/trunk/test/testskiplist.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testskiplist.c?rev=1664467&r1=1664466&r2=1664467&view=diff
==============================================================================
--- apr/apr/trunk/test/testskiplist.c (original)
+++ apr/apr/trunk/test/testskiplist.c Thu Mar  5 19:54:15 2015
@@ -244,7 +244,7 @@ static void skiplist_random_loop(abts_ca
 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,
     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);
 }
 



Mime
View raw message