summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-hashmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index de2bd083b9..d85b8dc58e 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -194,16 +194,18 @@ int cmd__hashmap(int argc, const char **argv)
free(entry);
} else if (!strcmp("get", cmd) && p1) {
+ struct hashmap_entry *e;
/* lookup entry in hashmap */
- entry = hashmap_get_from_hash(&map, hash, p1);
+ e = hashmap_get_from_hash(&map, hash, p1);
/* print result */
- if (!entry)
+ if (!e)
puts("NULL");
- while (entry) {
+ while (e) {
+ entry = container_of(e, struct test_entry, ent);
puts(get_value(entry));
- entry = hashmap_get_next(&map, &entry->ent);
+ e = hashmap_get_next(&map, e);
}
} else if (!strcmp("remove", cmd) && p1) {