remove test_ prefix from tests

This commit is contained in:
Anthony Pesch 2016-12-17 14:31:40 -08:00
parent 292ce8c38d
commit a0a1108d88
6 changed files with 25 additions and 25 deletions

View File

@ -407,10 +407,10 @@ if(BUILD_TESTS)
# #
## build test binary ## build test binary
set(RETEST_SOURCES set(RETEST_SOURCES
test/test_dead_code_elimination_pass.c test/test_dead_code_elimination.c
test/test_interval_tree.c test/test_interval_tree.c
test/test_list.c test/test_list.c
test/test_load_store_elimination_pass.c test/test_load_store_elimination.c
#test/test_minmax_heap.cc #test/test_minmax_heap.cc
#test/test_sh4.cc #test/test_sh4.cc
#${asm_inc} #${asm_inc}

View File

@ -13,13 +13,13 @@ struct test {
struct list_node it; struct list_node it;
}; };
#define TEST(name) \ #define TEST(name) \
static void name(); \ static void test_##name(); \
CONSTRUCTOR(TEST_REGISTER_##name) { \ CONSTRUCTOR(TEST_REGISTER_##name) { \
static struct test test = {#name, &name, {0}}; \ static struct test test = {"test_" #name, &test_##name, {0}}; \
test_register(&test); \ test_register(&test); \
} \ } \
void name() void test_##name()
void test_register(struct test *test); void test_register(struct test *test);

View File

@ -5,7 +5,7 @@
static uint8_t ir_buffer[1024 * 1024]; static uint8_t ir_buffer[1024 * 1024];
static char scratch_buffer[1024 * 1024]; static char scratch_buffer[1024 * 1024];
TEST(test_dead_code_elimination_pass) { TEST(dead_code_elimination) {
static const char input_str[] = static const char input_str[] =
"i32 %0 = load_context i32 0xbc\n" "i32 %0 = load_context i32 0xbc\n"
"i32 %1 = load_slow i32 %0\n" "i32 %1 = load_slow i32 %0\n"

View File

@ -26,7 +26,7 @@ static void init_interval_tree(struct rb_tree *t) {
} }
} }
TEST(test_interval_tree_size) { TEST(interval_tree_size) {
struct rb_tree tree = {0}; struct rb_tree tree = {0};
init_interval_tree(&tree); init_interval_tree(&tree);
@ -34,7 +34,7 @@ TEST(test_interval_tree_size) {
CHECK_EQ(size, MAX_NODES); CHECK_EQ(size, MAX_NODES);
} }
TEST(test_interval_tree_height) { TEST(interval_tree_height) {
struct rb_tree tree = {0}; struct rb_tree tree = {0};
init_interval_tree(&tree); init_interval_tree(&tree);
@ -43,7 +43,7 @@ TEST(test_interval_tree_height) {
CHECK(height <= 2 * log2(size + 1)); CHECK(height <= 2 * log2(size + 1));
} }
TEST(test_interval_tree_remove) { TEST(interval_tree_remove) {
struct rb_tree tree = {0}; struct rb_tree tree = {0};
init_interval_tree(&tree); init_interval_tree(&tree);
@ -66,7 +66,7 @@ TEST(test_interval_tree_remove) {
} }
} }
TEST(test_interval_tree_clear) { TEST(interval_tree_clear) {
struct rb_tree tree = {0}; struct rb_tree tree = {0};
init_interval_tree(&tree); init_interval_tree(&tree);
@ -76,7 +76,7 @@ TEST(test_interval_tree_clear) {
CHECK_EQ(size, 0); CHECK_EQ(size, 0);
} }
TEST(test_interval_tree_find) { TEST(interval_tree_find) {
struct rb_tree tree = {0}; struct rb_tree tree = {0};
init_interval_tree(&tree); init_interval_tree(&tree);
@ -117,7 +117,7 @@ TEST(test_interval_tree_find) {
} }
} }
TEST(test_interval_tree_find_destructive) { TEST(interval_tree_find_destructive) {
struct rb_tree tree = {0}; struct rb_tree tree = {0};
init_interval_tree(&tree); init_interval_tree(&tree);

View File

@ -46,7 +46,7 @@ static void validate_people(struct list *people, struct person **expected,
} }
/* add tests */ /* add tests */
TEST(test_intrusive_list_append) { TEST(intrusive_list_append) {
struct list people = {0}; struct list people = {0};
list_add(&people, &aaa.it); list_add(&people, &aaa.it);
list_add(&people, &bbb.it); list_add(&people, &bbb.it);
@ -57,7 +57,7 @@ TEST(test_intrusive_list_append) {
validate_people(&people, expected, num_expected); validate_people(&people, expected, num_expected);
} }
TEST(test_intrusive_list_prepend) { TEST(intrusive_list_prepend) {
struct list people = {0}; struct list people = {0};
list_add_after(&people, NULL, &aaa.it); list_add_after(&people, NULL, &aaa.it);
list_add_after(&people, NULL, &bbb.it); list_add_after(&people, NULL, &bbb.it);
@ -69,7 +69,7 @@ TEST(test_intrusive_list_prepend) {
} }
/* remove tests */ /* remove tests */
TEST(test_intrusive_list_remove_head) { TEST(intrusive_list_remove_head) {
struct list people = {0}; struct list people = {0};
init_people(&people); init_people(&people);
@ -80,7 +80,7 @@ TEST(test_intrusive_list_remove_head) {
validate_people(&people, expected, num_expected); validate_people(&people, expected, num_expected);
} }
TEST(test_intrusive_list_remove_middle) { TEST(intrusive_list_remove_middle) {
struct list people = {0}; struct list people = {0};
init_people(&people); init_people(&people);
@ -91,7 +91,7 @@ TEST(test_intrusive_list_remove_middle) {
validate_people(&people, expected, num_expected); validate_people(&people, expected, num_expected);
} }
TEST(test_intrusive_list_remove_tail) { TEST(intrusive_list_remove_tail) {
struct list people = {0}; struct list people = {0};
init_people(&people); init_people(&people);
@ -102,7 +102,7 @@ TEST(test_intrusive_list_remove_tail) {
validate_people(&people, expected, num_expected); validate_people(&people, expected, num_expected);
} }
TEST(test_intrusive_list_remove_clear) { TEST(intrusive_list_remove_clear) {
struct list people = {0}; struct list people = {0};
init_people(&people); init_people(&people);
@ -124,7 +124,7 @@ int person_sort(const struct list_node *list_lhs,
return strcmp(rhs->name, lhs->name); return strcmp(rhs->name, lhs->name);
} }
TEST(test_intrusive_list_empty_sort) { TEST(intrusive_list_empty_sort) {
struct list people = {0}; struct list people = {0};
list_sort(&people, &person_sort); list_sort(&people, &person_sort);
@ -132,7 +132,7 @@ TEST(test_intrusive_list_empty_sort) {
CHECK(list_empty(&people)); CHECK(list_empty(&people));
} }
TEST(test_intrusive_list_sort) { TEST(intrusive_list_sort) {
struct list people = {0}; struct list people = {0};
init_people(&people); init_people(&people);

View File

@ -5,7 +5,7 @@
static uint8_t ir_buffer[1024 * 1024]; static uint8_t ir_buffer[1024 * 1024];
static char scratch_buffer[1024 * 1024]; static char scratch_buffer[1024 * 1024];
TEST(test_load_store_elimination_pass_test) { TEST(load_store_elimination) {
static const char input_str[] = static const char input_str[] =
"store_context i32 0x104, i32 0x0\n" "store_context i32 0x104, i32 0x0\n"
"store_context i32 0x100, i32 0x0\n" "store_context i32 0x100, i32 0x0\n"