96 } |
96 } |
97 free(test); |
97 free(test); |
98 } |
98 } |
99 |
99 |
100 CX_TEST(test_allocator_default_free) { |
100 CX_TEST(test_allocator_default_free) { |
101 void *test = malloc(16); |
101 void *test = cxMalloc(cxDefaultAllocator, 16); |
102 CX_TEST_DO { |
102 CX_TEST_DO { |
103 // we cannot assert sth. but valgrind will detect an error |
103 // we cannot assert sth. but valgrind will detect an error |
104 cxFree(cxDefaultAllocator, test); |
104 cxFree(cxDefaultAllocator, test); |
105 CX_TEST_ASSERT(true); |
105 CX_TEST_ASSERT(true); |
106 } |
106 } |
179 } |
179 } |
180 free(test); |
180 free(test); |
181 } |
181 } |
182 |
182 |
183 static void *test_allocator_mock_failing_realloc( |
183 static void *test_allocator_mock_failing_realloc( |
184 __attribute__((__unused__))void *p, |
184 cx_attr_unused void *p, |
185 __attribute__((__unused__))void *d, |
185 cx_attr_unused void *d, |
186 __attribute__((__unused__))size_t n |
186 cx_attr_unused size_t n |
187 ) { |
187 ) { |
188 return NULL; |
188 return NULL; |
189 } |
189 } |
190 |
190 |
191 CX_TEST(test_allocator_reallocate_fails) { |
191 CX_TEST(test_allocator_reallocate_fails) { |