tests/test_list.c

changeset 1483
97a6cf1520ba
parent 1481
1dda1eed1899
--- a/tests/test_list.c	Mon Nov 10 21:36:15 2025 +0100
+++ b/tests/test_list.c	Mon Nov 10 21:56:09 2025 +0100
@@ -2754,6 +2754,7 @@
     cxListFree(subtrahend);
     cxListFree(expected);
     CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
+    cx_testing_allocator_destroy(&talloc);
 }
 
 CX_TEST(test_list_difference_unsorted) {
@@ -2846,6 +2847,7 @@
     cxListFree(other);
     cxListFree(expected);
     CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
+    cx_testing_allocator_destroy(&talloc);
 }
 
 CX_TEST(test_list_intersection_unsorted) {
@@ -2950,6 +2952,7 @@
     cxListFree(other);
     cxListFree(expected);
     CX_TEST_ASSERT(cx_testing_allocator_verify(&talloc));
+    cx_testing_allocator_destroy(&talloc);
 }
 
 CX_TEST(test_list_union_unsorted) {
@@ -2996,12 +2999,10 @@
     cxCollectionCompareFunc(ld, cx_cmp_int);
     cxListInsertSortedArray(ld, d, cx_nmemb(d));
 
-    CxList *d1 = cxArrayListCreateSimple(CX_STORE_POINTERS, 8);
+    CxList *d1 = cxArrayListCreateSimple(sizeof(int), 8);
     cxCollectionCompareFunc(d1, cx_cmp_int);
-    cxDefineAdvancedDestructor(d1, cxFree, (void*) cxDefaultAllocator);
-    CxList *d2 = cxArrayListCreateSimple(CX_STORE_POINTERS, 8);
+    CxList *d2 = cxArrayListCreateSimple(sizeof(int), 8);
     cxCollectionCompareFunc(d2, cx_cmp_int);
-    cxDefineAdvancedDestructor(d2, cxFree, (void*) cxDefaultAllocator);
 
     CX_TEST_DO {
         // clone a into d1
@@ -3015,7 +3016,7 @@
         CxList *expected_union = cxArrayListCreateSimple(sizeof(int), 8);
         {
             int expected[] = {1, 2, 3, 5, 7, 8, 9, 10, 11};
-            cxListInsertSortedArray(expected_union, expected, cx_nmemb(expected));
+            cxListAddArray(expected_union, expected, cx_nmemb(expected));
         }
         CX_TEST_ASSERT(0 == cxListCompare(d2, expected_union));
         cxListFree(expected_union);
@@ -3027,7 +3028,7 @@
         CxList *expected_intersection = cxArrayListCreateSimple(sizeof(int), 8);
         {
             int expected[] = {2, 8, 10};
-            cxListInsertSortedArray(expected_intersection, expected, cx_nmemb(expected));
+            cxListAddArray(expected_intersection, expected, cx_nmemb(expected));
         }
         CX_TEST_ASSERT(0 == cxListCompare(d1, expected_intersection));
         cxListFree(expected_intersection);
@@ -3039,7 +3040,7 @@
         CxList *expected_difference = cxArrayListCreateSimple(sizeof(int), 8);
         {
             int expected[] = {2, 10};
-            cxListInsertSortedArray(expected_difference, expected, cx_nmemb(expected));
+            cxListAddArray(expected_difference, expected, cx_nmemb(expected));
         }
         CX_TEST_ASSERT(0 == cxListCompare(d2, expected_difference));
         cxListFree(expected_difference);

mercurial