From 1e8fa138696f28cf712d50d85b91afce1faec655 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Fri, 13 Mar 2020 11:26:48 +0100 Subject: add whitespace control for statements --- tests/test_hashmap.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'tests/test_hashmap.c') diff --git a/tests/test_hashmap.c b/tests/test_hashmap.c index d78f768..b9e1cfd 100644 --- a/tests/test_hashmap.c +++ b/tests/test_hashmap.c @@ -6,26 +6,21 @@ START_TESTS TEST(hashmap) { struct hashmap *hm = hashmap_new(); assert(hashmap_get(hm, "foo") == NULL, "expected NULL"); - hashmap_insert(hm, "foo", "bar"); char *value = hashmap_get(hm, "foo"); - assert(value != NULL, "expected value, got NULL"); - assert(strcmp(value, "bar") == 0, "expected %s, got %s", "bar", value); - + assert_str(value, "bar"); hashmap_free(hm); } TEST(dot_notation) { - struct hashmap *user = hashmap_new(); hashmap_insert(user, "name", "Danny"); struct hashmap *hm = hashmap_new(); hashmap_insert(hm, "user", user); + assert(hashmap_resolve(hm, "user") == user, "expected user hashmap, got something else"); char *value = (char *) hashmap_resolve(hm, "user.name"); - assert(value != NULL, "expected value, got NULL"); - assert(strcmp(value, "Danny") == 0, "expected %s, got %s", "Danny", value); - + assert_str(value, "Danny"); hashmap_free(hm); } -- cgit v1.2.3