diff -r 3539dd99ab92 -r cfc1193b1e65 test/test_allocator.c --- a/test/test_allocator.c Sun Feb 07 17:17:46 2021 +0100 +++ b/test/test_allocator.c Sun Feb 07 18:08:21 2021 +0100 @@ -31,36 +31,33 @@ #include void test_default_allocator_available(void) { - cx_allocator_class* clazz = cxDefaultAllocator->cl; - CU_ASSERT_PTR_EQUAL(clazz->malloc, cx_malloc_stdlib) - CU_ASSERT_PTR_EQUAL(clazz->realloc, cx_realloc_stdlib) - CU_ASSERT_PTR_EQUAL(clazz->calloc, cx_calloc_stdlib) - CU_ASSERT_PTR_EQUAL(clazz->free, cx_free_stdlib) + cx_allocator_class *clazz = cxDefaultAllocator->cl; + CU_ASSERT_PTR_EQUAL(clazz, &cx_default_allocator_class) } void test_default_malloc(void) { - void* test = cxMalloc(cxDefaultAllocator, 16); + void *test = cxMalloc(cxDefaultAllocator, 16); CU_ASSERT_PTR_NOT_NULL(test); free(test); } void test_default_realloc(void) { - void* test = calloc(8, 1); + void *test = calloc(8, 1); memcpy(test, "Test", 4); test = cxRealloc(cxDefaultAllocator, test, 16); - CU_ASSERT_PTR_NOT_NULL(test); + CU_ASSERT_PTR_NOT_NULL(test) CU_ASSERT_STRING_EQUAL("Test", test) free(test); } void test_default_calloc(void) { - void* test = cxCalloc(cxDefaultAllocator, 8, 2); - CU_ASSERT_PTR_NOT_NULL(test); + void *test = cxCalloc(cxDefaultAllocator, 8, 2); + CU_ASSERT_PTR_NOT_NULL(test) free(test); } void test_default_free(void) { - void* test = malloc(16); + void *test = malloc(16); cxFree(cxDefaultAllocator, test); CU_PASS("Testing standard free is not possible.") } @@ -84,7 +81,7 @@ (NULL == CU_add_test(suite, "test of realloc()", test_default_realloc)) || (NULL == CU_add_test(suite, "test of realloc()", test_default_calloc)) || (NULL == CU_add_test(suite, "test of free()", test_default_free)) - ) { + ) { CU_cleanup_registry(); return CU_get_error(); }