apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r587436 - in /apr/apr-util/trunk/test: testmemcache.c testrmm.c
Date Tue, 23 Oct 2007 09:54:24 GMT
Author: wrowe
Date: Tue Oct 23 02:54:23 2007
New Revision: 587436

URL: http://svn.apache.org/viewvc?rev=587436&view=rev
Log:
Correct two tests for size_t > int

Modified:
    apr/apr-util/trunk/test/testmemcache.c
    apr/apr-util/trunk/test/testrmm.c

Modified: apr/apr-util/trunk/test/testmemcache.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/test/testmemcache.c?rev=587436&r1=587435&r2=587436&view=diff
==============================================================================
--- apr/apr-util/trunk/test/testmemcache.c (original)
+++ apr/apr-util/trunk/test/testmemcache.c Tue Oct 23 02:54:23 2007
@@ -185,7 +185,7 @@
     char *k, *v;
     
     k = apr_pstrcat(p, prefix, apr_itoa(p, i), NULL);
-    v = apr_pstrndup(p, txt, randval(strlen(txt)));
+    v = apr_pstrndup(p, txt, randval((apr_uint32_t)strlen(txt)));
     
     apr_hash_set(h, k, APR_HASH_KEY_STRING, v);
   }

Modified: apr/apr-util/trunk/test/testrmm.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/test/testrmm.c?rev=587436&r1=587435&r2=587436&view=diff
==============================================================================
--- apr/apr-util/trunk/test/testrmm.c (original)
+++ apr/apr-util/trunk/test/testrmm.c Tue Oct 23 02:54:23 2007
@@ -37,7 +37,7 @@
     apr_shm_t *shm;
     apr_rmm_t *rmm;
     apr_size_t size, fragsize;
-    apr_rmm_off_t *off;
+    apr_rmm_off_t *off, off2;
     int i;
     void *entity;
 
@@ -66,15 +66,15 @@
     }
 
     /* Checking for out of memory allocation */
-    i = apr_rmm_malloc(rmm, FRAG_SIZE * FRAG_COUNT);
-    ABTS_INT_EQUAL(tc, i, 0);
+    off2 = apr_rmm_malloc(rmm, FRAG_SIZE * FRAG_COUNT);
+    ABTS_TRUE(tc, !off2);
 
     /* Checking each fragment for address alignment */
     for (i = 0; i < FRAG_COUNT; i++) {
         char *c = apr_rmm_addr_get(rmm, off[i]);
         apr_size_t sc = (apr_size_t)c;
 
-        ABTS_TRUE(tc, off[i]);
+        ABTS_TRUE(tc, !!off[i]);
         ABTS_TRUE(tc, !(sc & 7));
     }
 
@@ -137,8 +137,8 @@
     /* Checking realloc */
     off[0] = apr_rmm_calloc(rmm, SHARED_SIZE - 100);
     off[1] = apr_rmm_calloc(rmm, 100);
-    ABTS_TRUE(tc, off[0]);
-    ABTS_TRUE(tc, off[1]);
+    ABTS_TRUE(tc, !!off[0]);
+    ABTS_TRUE(tc, !!off[1]);
 
     entity = apr_rmm_addr_get(rmm, off[1]);
     rv = apr_rmm_free(rmm, off[0]);
@@ -157,7 +157,7 @@
 
     /* now we can realloc off[1] and get many more bytes */
     off[0] = apr_rmm_realloc(rmm, entity, SHARED_SIZE - 100);
-    ABTS_TRUE(tc, off[0]);
+    ABTS_TRUE(tc, !!off[0]);
 
     {
         unsigned char *c = apr_rmm_addr_get(rmm, off[0]);



Mime
View raw message