Sat, 16 Apr 2022 08:59:51 +0200
do not use macro for suite name
test/test_allocator.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/test/test_allocator.cpp Sat Apr 16 08:58:27 2022 +0200 1.2 +++ b/test/test_allocator.cpp Sat Apr 16 08:59:51 2022 +0200 1.3 @@ -29,20 +29,18 @@ 1.4 #include "cx/allocator.h" 1.5 #include <gtest/gtest.h> 1.6 1.7 -#define SUITE_NAME Allocator 1.8 - 1.9 -TEST(SUITE_NAME, DefaultAllocator) { 1.10 +TEST(Allocator, DefaultAllocator) { 1.11 cx_allocator_class *clazz = cxDefaultAllocator->cl; 1.12 ASSERT_NE(clazz, nullptr); 1.13 } 1.14 1.15 -TEST(SUITE_NAME, DefaultMalloc) { 1.16 +TEST(Allocator, DefaultMalloc) { 1.17 void *test = cxMalloc(cxDefaultAllocator, 16); 1.18 ASSERT_NE(test, nullptr); 1.19 free(test); 1.20 } 1.21 1.22 -TEST(SUITE_NAME, DefaultRealloc) { 1.23 +TEST(Allocator, DefaultRealloc) { 1.24 void *test = calloc(8, 1); 1.25 memcpy(test, "Test", 5); 1.26 test = cxRealloc(cxDefaultAllocator, test, 16); 1.27 @@ -51,7 +49,7 @@ 1.28 free(test); 1.29 } 1.30 1.31 -TEST(SUITE_NAME, Reallocate) { 1.32 +TEST(Allocator, Reallocate) { 1.33 void *test = calloc(8, 1); 1.34 memcpy(test, "Test", 5); 1.35 int ret = cxReallocate(cxDefaultAllocator, &test, 16); 1.36 @@ -61,14 +59,14 @@ 1.37 free(test); 1.38 } 1.39 1.40 -TEST(SUITE_NAME, DefaultCalloc) { 1.41 +TEST(Allocator, DefaultCalloc) { 1.42 char *test = reinterpret_cast<char *>(cxCalloc(cxDefaultAllocator, 8, 2)); 1.43 ASSERT_NE(test, nullptr); 1.44 for (int i = 0; i < 16; i++) ASSERT_EQ(test[i], 0); 1.45 free(test); 1.46 } 1.47 1.48 -TEST(SUITE_NAME, DefaultFree) { 1.49 +TEST(Allocator, DefaultFree) { 1.50 void *test = malloc(16); 1.51 EXPECT_NO_FATAL_FAILURE( 1.52 cxFree(cxDefaultAllocator, test);