diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2001-08-02 00:13:05 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2001-08-02 00:13:05 +0000 |
commit | b9ed26b243e7f133b7ba6b66306377006828aac3 (patch) | |
tree | 5d4ba897b21d9f26d7edae31bf2cd7f90b6fa874 /test | |
parent | 157ff05dc5894b5d8cb38838d8190cba8f667cd0 (diff) | |
download | libapr-b9ed26b243e7f133b7ba6b66306377006828aac3.tar.gz |
Context man, give me context
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62078 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r-- | test/testhash.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/testhash.c b/test/testhash.c index da1e9c3b0..d72eaf17b 100644 --- a/test/testhash.c +++ b/test/testhash.c @@ -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 @@ static void dump_hash(apr_hash_t *h) 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 @@ static void sum_hash(apr_hash_t *h, int *pcount, int *keySum, int *valSum) *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 @@ int main(int argc, const char *const argv[]) 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 @@ int main(int argc, const char *const argv[]) 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 @@ int main(int argc, const char *const argv[]) } 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 @@ int main(int argc, const char *const argv[]) 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 @@ int main(int argc, const char *const argv[]) 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); |