diff options
Diffstat (limited to 'src/or/test.c')
-rw-r--r-- | src/or/test.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/or/test.c b/src/or/test.c index b3b1d3e8a6..816e5dc53e 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -972,19 +972,6 @@ test_gzip(void) tor_free(buf1); } -static void * -_squareAndRemoveK4(const char *key, void*val, void *data) -{ - int *ip = (int*)data; - intptr_t v; - if (strcmp(key,"K4") == 0) { - ++(*ip); - return NULL; - } - v = (intptr_t)val; - return (void*)(v*v); -} - static void test_strmap(void) { @@ -1016,13 +1003,7 @@ test_strmap(void) strmap_set(map, "K5", (void*)104); strmap_set(map, "K6", (void*)105); - count = 0; - strmap_foreach(map, _squareAndRemoveK4, &count); - test_eq(count, 1); - test_eq_ptr(strmap_get(map, "K4"), NULL); - test_eq_ptr(strmap_get(map, "K1"), (void*)10000); - test_eq_ptr(strmap_get(map, "K6"), (void*)11025); - +#if 0 iter = strmap_iter_init(map); strmap_iter_get(iter,&k,&v); test_streq(k, "K1"); @@ -1045,6 +1026,8 @@ test_strmap(void) /* Make sure we removed K2, but not the others. */ test_eq_ptr(strmap_get(map, "K2"), NULL); test_eq_ptr(strmap_get(map, "K5"), (void*)10816); +#endif + /* Clean up after ourselves. */ strmap_free(map, NULL); |