chiark / gitweb /
test: hashmap-plain - make coverity happy
authorTom Gundersen <teg@jklm.no>
Tue, 4 Nov 2014 15:20:22 +0000 (16:20 +0100)
committerTom Gundersen <teg@jklm.no>
Wed, 5 Nov 2014 15:54:22 +0000 (16:54 +0100)
Check return value of hashmap_ensure_allocated().

CID#1250807.

src/test/test-hashmap-plain.c

index 63f2f3e..6f0910a 100644 (file)
@@ -246,7 +246,7 @@ static void test_hashmap_put(void) {
         int valid_hashmap_put;
         void *val1 = (void*) "val 1";
 
-        hashmap_ensure_allocated(&m, &string_hash_ops);
+        assert_se(hashmap_ensure_allocated(&m, &string_hash_ops) >= 0);
         assert_se(m);
 
         valid_hashmap_put = hashmap_put(m, "key 1", val1);