tests/test_properties.c

changeset 1605
55b13f583356
parent 1582
32b82c424252
--- a/tests/test_properties.c	Sun Dec 14 16:21:09 2025 +0100
+++ b/tests/test_properties.c	Sun Dec 14 17:30:17 2025 +0100
@@ -521,8 +521,8 @@
         // preparation of test file complete
 
         // we want to load the properties into a map of char* pointers
-        CxMap *map = cxHashMapCreateSimple(CX_STORE_POINTERS);
-        cxDefineAdvancedDestructor(map, cxFree, &talloc);
+        CxMap *map = cxHashMapCreate(NULL, CX_STORE_POINTERS, 0);
+        cxSetAdvancedDestructor(map, cxFree, &talloc);
         CxPropertiesStatus status = cxPropertiesLoadDefault(&talloc.base, fname, map);
 
         CX_TEST_ASSERT(status == CX_PROPERTIES_NO_ERROR);
@@ -570,7 +570,7 @@
         fclose(f);
         f = NULL;
 
-        CxMap *map = cxHashMapCreateSimple(CX_STORE_POINTERS);
+        CxMap *map = cxHashMapCreate(NULL, CX_STORE_POINTERS, 0);
         // store something that we don't want to be deleted
         cxMapPut(map, "test", "value");
         CxPropertiesStatus status = cxPropertiesLoadDefault(&talloc.base, fname, map);
@@ -601,7 +601,7 @@
         fclose(f);
         f = NULL;
 
-        CxMap *map = cxHashMapCreateSimple(CX_STORE_POINTERS);
+        CxMap *map = cxHashMapCreate(NULL, CX_STORE_POINTERS, 0);
         CxPropertiesStatus status = cxPropertiesLoadDefault(&talloc.base, fname, map);
         CX_TEST_ASSERT(status == CX_PROPERTIES_NO_DATA);
         CX_TEST_ASSERT(cxMapSize(map) == 0);
@@ -627,8 +627,8 @@
         fclose(f);
         f = NULL;
 
-        CxMap *map = cxHashMapCreateSimple(CX_STORE_POINTERS);
-        cxDefineAdvancedDestructor(map, cxFree, &talloc);
+        CxMap *map = cxHashMapCreate(NULL, CX_STORE_POINTERS, 0);
+        cxSetAdvancedDestructor(map, cxFree, &talloc);
         CxPropertiesStatus status = cxPropertiesLoadDefault(&talloc.base, fname, map);
         CX_TEST_ASSERT(status == CX_PROPERTIES_INVALID_EMPTY_KEY);
         // all keys that could be successfully parsed are added
@@ -647,7 +647,7 @@
 
 CX_TEST(test_properties_load_file_not_exists) {
     CX_TEST_DO {
-        CxMap *map = cxHashMapCreateSimple(CX_STORE_POINTERS);
+        CxMap *map = cxHashMapCreate(NULL, CX_STORE_POINTERS, 0);
         CxPropertiesStatus status = cxPropertiesLoadDefault(NULL, "does-definitely-not-exist", map);
         CX_TEST_ASSERT(status == CX_PROPERTIES_FILE_ERROR);
         cxMapFree(map);
@@ -666,8 +666,8 @@
         fclose(f);
         f = NULL;
 
-        CxMap *map = cxHashMapCreateSimple(sizeof(cxmutstr));
-        cxDefineAdvancedDestructor(map, cx_strfree_a, &talloc);
+        CxMap *map = cxHashMapCreate(NULL, sizeof(cxmutstr), 0);
+        cxSetAdvancedDestructor(map, cx_strfree_a, &talloc);
         CxPropertiesStatus status = cxPropertiesLoadDefault(&talloc.base, fname, map);
         CX_TEST_ASSERT(status == CX_PROPERTIES_NO_ERROR);
         CX_TEST_ASSERT(cxMapSize(map) == 2);
@@ -697,8 +697,8 @@
         fclose(f);
         f = NULL;
 
-        CxMap *map = cxHashMapCreateSimple(sizeof(CxBuffer));
-        cxDefineAdvancedDestructor(map, cxFree, &talloc);
+        CxMap *map = cxHashMapCreate(NULL, sizeof(CxBuffer), 0);
+        cxSetAdvancedDestructor(map, cxFree, &talloc);
         CxPropertiesStatus status = cxPropertiesLoadDefault(&talloc.base, fname, map);
         CX_TEST_ASSERT(status == CX_PROPERTIES_MAP_ERROR);
         CX_TEST_ASSERT(cxMapSize(map) == 0);

mercurial