summaryrefslogtreecommitdiff
path: root/src/test/test-hashmap-plain.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-02-19 12:23:43 +0100
committerDaniel Mack <github@zonque.org>2016-02-19 12:23:43 +0100
commitdfec18925e3ca4d850e01dcf65499fca47cb0589 (patch)
tree4c690e12456e0c1a3c7171aa62314b5328b1467d /src/test/test-hashmap-plain.c
parent22b73e9cd79e6a6580e72cd269098e45a7971086 (diff)
parent240a7ba9d8eaf76e1f3fb7a5b8424ab6eaead59d (diff)
Merge pull request #2660 from keszybz/memleaks-and-ubsan
Memleaks and ubsan
Diffstat (limited to 'src/test/test-hashmap-plain.c')
-rw-r--r--src/test/test-hashmap-plain.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/test/test-hashmap-plain.c b/src/test/test-hashmap-plain.c
index 6bf33306a9..1bd5c02f87 100644
--- a/src/test/test-hashmap-plain.c
+++ b/src/test/test-hashmap-plain.c
@@ -323,26 +323,29 @@ static void test_hashmap_remove_value(void) {
_cleanup_hashmap_free_ Hashmap *m = NULL;
char *r;
- r = hashmap_remove_value(NULL, "key 1", (void*) "val 1");
+ char val1[] = "val 1";
+ char val2[] = "val 2";
+
+ r = hashmap_remove_value(NULL, "key 1", val1);
assert_se(r == NULL);
m = hashmap_new(&string_hash_ops);
assert_se(m);
- r = hashmap_remove_value(m, "key 1", (void*) "val 1");
+ r = hashmap_remove_value(m, "key 1", val1);
assert_se(r == NULL);
- hashmap_put(m, "key 1", (void*) "val 1");
- hashmap_put(m, "key 2", (void*) "val 2");
+ hashmap_put(m, "key 1", val1);
+ hashmap_put(m, "key 2", val2);
- r = hashmap_remove_value(m, "key 1", (void*) "val 1");
+ r = hashmap_remove_value(m, "key 1", val1);
assert_se(streq(r, "val 1"));
r = hashmap_get(m, "key 2");
assert_se(streq(r, "val 2"));
assert_se(!hashmap_get(m, "key 1"));
- r = hashmap_remove_value(m, "key 2", (void*) "val 1");
+ r = hashmap_remove_value(m, "key 2", val1);
assert_se(r == NULL);
r = hashmap_get(m, "key 2");