tests/test_hash_map.c

changeset 993
b642eca4b956
parent 985
68754c7de906
child 994
3603bdf4a78b
--- a/tests/test_hash_map.c	Tue Nov 26 22:00:03 2024 +0100
+++ b/tests/test_hash_map.c	Tue Nov 26 22:16:27 2024 +0100
@@ -56,7 +56,7 @@
         cxMapStoreObjects(map);
         CX_TEST_ASSERT(!map->collection.store_pointer);
 
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);
@@ -78,7 +78,7 @@
         CX_TEST_ASSERT(map->collection.store_pointer);
         CX_TEST_ASSERT(map->collection.elem_size == sizeof(void *));
 
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);
@@ -119,7 +119,7 @@
         CX_TEST_ASSERT(0 == strcmp(cxMapGet(map, "key 9"), "val 9"));
         CX_TEST_ASSERT(0 == strcmp(cxMapGet(map, "key 10"), "val 10"));
 
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);
@@ -144,7 +144,7 @@
         CX_TEST_ASSERT(result == 0);
         CX_TEST_ASSERT(((struct cx_hash_map_s *)map)->bucket_count == 8);
 
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);
@@ -170,7 +170,7 @@
         CX_TEST_ASSERT(cxMapGet(map, "key 2") == NULL);
         CX_TEST_ASSERT(cxMapGet(map, "key 3") == NULL);
 
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);
@@ -220,7 +220,7 @@
         }
         CX_TEST_ASSERT(s3found && s4found && s5found);
 
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);
@@ -254,7 +254,7 @@
         CX_TEST_ASSERT(cxMapGet(map, "key 5") == NULL);
         CX_TEST_ASSERT(cxMapGet(map, "key 6") != NULL);
 
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);
@@ -333,7 +333,7 @@
 
     v1[0] = v2[0] = v4[0] = v5[0] = 'c';
 
-    cxMapDestroy(map);
+    cxMapFree(map);
 
     CX_TEST_ASSERT(0 == strcmp(v1, "cK"));
     CX_TEST_ASSERT(0 == strcmp(v2, "cK"));
@@ -409,7 +409,7 @@
         // assertion not possible
         // test that no segfault happens and valgrind is happy
         cxMapClear(cxEmptyMap);
-        cxMapDestroy(cxEmptyMap);
+        cxMapFree(cxEmptyMap);
         CX_TEST_ASSERT(true);
     }
 }
@@ -453,7 +453,7 @@
 
         CX_TEST_ASSERT(map->collection.size == 0);
 
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);
@@ -649,7 +649,7 @@
         }
 
         // destroy the map and verify the memory (de)allocations
-        cxMapDestroy(map);
+        cxMapFree(map);
         CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
     }
     cx_testing_allocator_destroy(&talloc);

mercurial