apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/test testhash.c
Date Thu, 02 Aug 2001 00:13:05 GMT
wrowe       01/08/01 17:13:05

  Modified:    test     testhash.c
  Log:
    Context man, give me context
  
  Revision  Changes    Path
  1.2       +10 -10    apr/test/testhash.c
  
  Index: testhash.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testhash.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testhash.c	2001/07/19 03:45:33	1.1
  +++ testhash.c	2001/08/02 00:13:05	1.2
  @@ -67,14 +67,14 @@
   #include <string.h>
   #endif
   
  -static void dump_hash(apr_hash_t *h) 
  +static void dump_hash(apr_pool_t *p, apr_hash_t *h) 
   {
       apr_hash_index_t *hi;
       char *val, *key;
       int len;
       int i = 0;
   
  -    for (hi = apr_hash_first(h); hi; hi = apr_hash_next(hi)) {
  +    for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) {
           apr_hash_this(hi,(void*) &key, &len,(void*) &val);
           fprintf(stdout, "Key %s (%d) Value %s\n",key,len,val);
           i++;
  @@ -86,7 +86,7 @@
           fprintf(stdout, "#entries %d \n", i);
   }
   
  -static void sum_hash(apr_hash_t *h, int *pcount, int *keySum, int *valSum) 
  +static void sum_hash(apr_pool_t *p, apr_hash_t *h, int *pcount, int *keySum, int *valSum)

   {
       apr_hash_index_t *hi;
       void *val, *key;
  @@ -95,7 +95,7 @@
       *keySum = 0;
       *valSum = 0;
       *pcount = 0;
  -    for (hi = apr_hash_first(h); hi; hi = apr_hash_next(hi)) {
  +    for (hi = apr_hash_first(p, h); hi; hi = apr_hash_next(hi)) {
           apr_hash_this(hi, (void*)&key, NULL, &val);
           *valSum += *(int *)val;
           *keySum += *(int *)key;
  @@ -161,7 +161,7 @@
           fprintf(stderr, "ERROR:apr_hash_get FOO3 = %s (should be bar3)\n",
                   result);
           
  -    dump_hash(h);
  +    dump_hash(cntxt, h);
   
       h2 =apr_hash_make(cntxt);
       if (h2 == NULL)  {
  @@ -184,7 +184,7 @@
           apr_hash_set(h2, key, sizeof(int), val);
       }
   
  -    sum_hash(h2, &i, &trySumKey, &trySumVal);
  +    sum_hash(cntxt, h2, &i, &trySumKey, &trySumVal);
       if (i==100) {
          fprintf(stdout, "All keys accounted for\n");
       } else {
  @@ -207,7 +207,7 @@
       } else {
         fprintf(stdout, "Delete working\n");
       }
  -    sum_hash(h2, &i, &trySumKey, &trySumVal);
  +    sum_hash(cntxt, h2, &i, &trySumKey, &trySumVal);
   
       sumKeys -= 891;
       sumVal -= 89;
  @@ -234,14 +234,14 @@
       if (apr_hash_count(h4) != apr_hash_count(h)) {
           fprintf(stderr,
                   "ERROR: overlay not working with blank overlay as overlay\n");
  -        dump_hash(h4);
  +        dump_hash(cntxt, h4);
       }
   
       h4 = apr_hash_overlay(cntxt, h, h3);
       if (apr_hash_count(h4) != apr_hash_count(h)) {
           fprintf(stderr,
                   "ERROR: overlay not working with blank overlay as base\n");
  -        dump_hash(h4);
  +        dump_hash(cntxt, h4);
       }
   
       h4 = apr_hash_overlay(cntxt, h, h2);
  @@ -253,7 +253,7 @@
       if (apr_hash_count(h4) != apr_hash_count(h))  {
           fprintf(stderr,
                   "ERROR: overlay not working when overlaying same hash\n");
  -        dump_hash(h4);
  +        dump_hash(cntxt, h4);
       }
           
       result = apr_hash_get(h4, "FOO2", APR_HASH_KEY_STRING);
  
  
  

Mime
View raw message