apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1666602 - /apr/apr/trunk/test/testskiplist.c
Date Fri, 13 Mar 2015 22:53:20 GMT
Author: ylavic
Date: Fri Mar 13 22:53:19 2015
New Revision: 1666602

URL: http://svn.apache.org/r1666602
Log:
skiplist: sync tests with 1.5.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=1666602&r1=1666601&r2=1666602&view=diff
==============================================================================
--- apr/apr/trunk/test/testskiplist.c (original)
+++ apr/apr/trunk/test/testskiplist.c Fri Mar 13 22:53:19 2015
@@ -249,17 +249,17 @@ typedef struct elem {
 static void add_int_to_skiplist(apr_skiplist *list, int n){
     int* a = apr_skiplist_alloc(list, sizeof(int));
     *a = n;
-    apr_skiplist_add(list, a);
+    apr_skiplist_insert(list, a);
 }
 
 static void add_elem_to_skiplist(apr_skiplist *list, elem n){
     elem* a = apr_skiplist_alloc(list, sizeof(elem));
     *a = n;
-    apr_skiplist_add(list, a);
+    apr_skiplist_insert(list, a);
 }
 
 static int comp(void *a, void *b){
-    return *((int*) a) - *((int*) b);
+    return (*((int*) a) < *((int*) b)) ? -1 : 1;
 }
 
 static int compk(void *a, void *b){
@@ -267,7 +267,7 @@ static int compk(void *a, void *b){
 }
 
 static int scomp(void *a, void *b){
-    return ((elem*) a)->a - ((elem*) b)->a;
+    return (((elem*) a)->a < ((elem*) b)->a) ? -1 : 1;
 }
 
 static int scompk(void *a, void *b){



Mime
View raw message