1.1 --- a/test/array_tests.c Sat Aug 10 08:47:25 2019 +0200 1.2 +++ b/test/array_tests.c Sat Aug 10 09:47:59 2019 +0200 1.3 @@ -33,7 +33,7 @@ 1.4 UcxArray array = ucx_array_new(16, sizeof(int)); 1.5 1.6 UCX_TEST_BEGIN 1.7 - ucx_array_free(&array); 1.8 + ucx_array_destroy(&array); 1.9 UCX_TEST_ASSERT(array.data == NULL, "data pointer not NULL after free"); 1.10 UCX_TEST_ASSERT(array.size == 0, "size not zero after free"); 1.11 UCX_TEST_ASSERT(array.capacity == 0, "capacity not zero after free"); 1.12 @@ -53,7 +53,7 @@ 1.13 UCX_TEST_ASSERT(array.allocator == ucx_default_allocator(), 1.14 "array not using the default allocator"); 1.15 UCX_TEST_END 1.16 - ucx_array_free(&array); 1.17 + ucx_array_destroy(&array); 1.18 } 1.19 1.20 UCX_TEST(test_ucx_array_append) { 1.21 @@ -88,7 +88,7 @@ 1.22 1.23 UCX_TEST_END 1.24 1.25 - ucx_array_free(&array); 1.26 + ucx_array_destroy(&array); 1.27 } 1.28 1.29 UCX_TEST(test_ucx_array_prepend) { 1.30 @@ -123,7 +123,7 @@ 1.31 1.32 UCX_TEST_END 1.33 1.34 - ucx_array_free(&array); 1.35 + ucx_array_destroy(&array); 1.36 } 1.37 1.38 UCX_TEST(test_ucx_array_set) { 1.39 @@ -157,7 +157,7 @@ 1.40 1.41 UCX_TEST_END 1.42 1.43 - ucx_array_free(&array); 1.44 + ucx_array_destroy(&array); 1.45 } 1.46 1.47 UCX_TEST(test_ucx_array_equals) { 1.48 @@ -214,10 +214,10 @@ 1.49 "compare using memcmp() failed"); 1.50 1.51 UCX_TEST_END 1.52 - ucx_array_free(&a1); 1.53 - ucx_array_free(&a2); 1.54 - ucx_array_free(&a3); 1.55 - ucx_array_free(&a4); 1.56 + ucx_array_destroy(&a1); 1.57 + ucx_array_destroy(&a2); 1.58 + ucx_array_destroy(&a3); 1.59 + ucx_array_destroy(&a4); 1.60 } 1.61 1.62 UCX_TEST(test_ucx_array_concat) { 1.63 @@ -253,8 +253,8 @@ 1.64 "arrays of different element size must not be concatenated"); 1.65 1.66 UCX_TEST_END 1.67 - ucx_array_free(&a1); 1.68 - ucx_array_free(&a2); 1.69 + ucx_array_destroy(&a1); 1.70 + ucx_array_destroy(&a2); 1.71 } 1.72 1.73 UCX_TEST(test_ucx_array_at) { 1.74 @@ -278,7 +278,7 @@ 1.75 1.76 UCX_TEST_END 1.77 1.78 - ucx_array_free(&array); 1.79 + ucx_array_destroy(&array); 1.80 } 1.81 1.82 UCX_TEST(test_ucx_array_find) { 1.83 @@ -309,7 +309,7 @@ 1.84 "failed using memcmp()"); 1.85 1.86 UCX_TEST_END 1.87 - ucx_array_free(&array); 1.88 + ucx_array_destroy(&array); 1.89 } 1.90 1.91 UCX_TEST(test_ucx_array_contains) { 1.92 @@ -340,7 +340,7 @@ 1.93 "false positive using memcmp()"); 1.94 1.95 UCX_TEST_END 1.96 - ucx_array_free(&array); 1.97 + ucx_array_destroy(&array); 1.98 } 1.99 1.100 UCX_TEST(test_ucx_array_remove) { 1.101 @@ -377,7 +377,7 @@ 1.102 UCX_TEST_ASSERT(array.size == 3, "wrong size after fast remove"); 1.103 1.104 UCX_TEST_END 1.105 - ucx_array_free(&array); 1.106 + ucx_array_destroy(&array); 1.107 } 1.108 1.109 UCX_TEST(test_ucx_array_clone) { 1.110 @@ -404,8 +404,8 @@ 1.111 1.112 UCX_TEST_END 1.113 1.114 - ucx_array_free(&array); 1.115 - ucx_array_free(©); 1.116 + ucx_array_destroy(&array); 1.117 + ucx_array_destroy(©); 1.118 } 1.119 1.120 static int ucx_cmp_int_reverse(const void* x, const void* y, void* data) { 1.121 @@ -467,8 +467,8 @@ 1.122 "failed for bigger arrays"); 1.123 UCX_TEST_END 1.124 1.125 - ucx_array_free(&expected); 1.126 - ucx_array_free(&array); 1.127 + ucx_array_destroy(&expected); 1.128 + ucx_array_destroy(&array); 1.129 } 1.130 1.131 UCX_TEST(test_ucx_array_autogrow) { 1.132 @@ -494,7 +494,7 @@ 1.133 UCX_TEST_ASSERT(elems[3] == 5 && elems[4] == 5, "corrupt data"); 1.134 1.135 UCX_TEST_END 1.136 - ucx_array_free(&array); 1.137 + ucx_array_destroy(&array); 1.138 } 1.139 1.140 UCX_TEST(test_ucx_array_shrink) { 1.141 @@ -505,7 +505,7 @@ 1.142 UCX_TEST_ASSERT(!ucx_array_shrink(&array), "failed"); 1.143 UCX_TEST_ASSERT(array.capacity == 4, "incorrect capacity after shrink"); 1.144 UCX_TEST_END 1.145 - ucx_array_free(&array); 1.146 + ucx_array_destroy(&array); 1.147 } 1.148 1.149 UCX_TEST(test_ucx_array_resize) { 1.150 @@ -523,7 +523,7 @@ 1.151 UCX_TEST_ASSERT(array.size == 4, "incorrect size after resize"); 1.152 1.153 UCX_TEST_END 1.154 - ucx_array_free(&array); 1.155 + ucx_array_destroy(&array); 1.156 } 1.157 1.158 UCX_TEST(test_ucx_array_reserve) { 1.159 @@ -538,5 +538,5 @@ 1.160 UCX_TEST_ASSERT(array.capacity == 32, "incorrect capacity after reserve"); 1.161 1.162 UCX_TEST_END 1.163 - ucx_array_free(&array); 1.164 + ucx_array_destroy(&array); 1.165 }