tests/test_mempool.c

changeset 993
b642eca4b956
parent 985
68754c7de906
--- a/tests/test_mempool.c	Tue Nov 26 22:00:03 2024 +0100
+++ b/tests/test_mempool.c	Tue Nov 26 22:16:27 2024 +0100
@@ -46,7 +46,7 @@
         CX_TEST_ASSERT(pool->size == 0);
         CX_TEST_ASSERT(pool->data != NULL);
     }
-    cxMempoolDestroy(pool);
+    cxMempoolFree(pool);
 }
 
 CX_TEST(test_mempool_malloc) {
@@ -65,7 +65,7 @@
         CX_TEST_ASSERT(pool->size == 6);
         CX_TEST_ASSERT(pool->capacity >= 6);
     }
-    cxMempoolDestroy(pool);
+    cxMempoolFree(pool);
 }
 
 CX_TEST(test_mempool_calloc) {
@@ -76,7 +76,7 @@
         CX_TEST_ASSERT(test[0] == 0);
         CX_TEST_ASSERT(test[1] == 0);
     }
-    cxMempoolDestroy(pool);
+    cxMempoolFree(pool);
 }
 
 static unsigned test_mempool_destructor_called;
@@ -107,7 +107,7 @@
         cxFree(pool->allocator, rdata);
         CX_TEST_ASSERT(test_mempool_destructor_called == 1);
     }
-    cxMempoolDestroy(pool);
+    cxMempoolFree(pool);
 }
 
 
@@ -131,7 +131,7 @@
         cxFree(pool->allocator, mem2);
         CX_TEST_ASSERT(pool->size == 3);
     }
-    cxMempoolDestroy(pool);
+    cxMempoolFree(pool);
 }
 
 CX_TEST(test_mempool_destroy) {
@@ -146,7 +146,7 @@
         CX_TEST_ASSERT(test_mempool_destructor_called == 1);
         data = cxMalloc(pool->allocator, sizeof(int));
         cxMempoolSetDestructor(data, test_mempool_destructor);
-        cxMempoolDestroy(pool);
+        cxMempoolFree(pool);
         CX_TEST_ASSERT(test_mempool_destructor_called == 2);
     }
 }
@@ -159,7 +159,7 @@
         cxMempoolSetDestructor(data, test_mempool_destructor);
         int donotfree = 0;
         cxMempoolRegister(pool, &donotfree, test_mempool_destructor);
-        cxMempoolDestroy(pool);
+        cxMempoolFree(pool);
         CX_TEST_ASSERT(test_mempool_destructor_called == 2);
     }
 }

mercurial