From 48d2c15ad639c028690a3cdaa72c494c8263b468 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 7 Nov 2019 13:34:59 +0200 Subject: [PATCH] tests: rename struct weston_test to weston_test_entry This avoids confusing it with the opaque struct weston_test from protocol/weston-test.xml. Signed-off-by: Pekka Paalanen --- tests/weston-test-runner.c | 17 +++++++++-------- tests/weston-test-runner.h | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/weston-test-runner.c b/tests/weston-test-runner.c index c269b69f..5e1585af 100644 --- a/tests/weston-test-runner.c +++ b/tests/weston-test-runner.c @@ -40,7 +40,7 @@ char __attribute__((weak)) *server_parameters=""; -extern const struct weston_test __start_test_section, __stop_test_section; +extern const struct weston_test_entry __start_test_section, __stop_test_section; static const char *test_name_; @@ -60,10 +60,10 @@ testlog(const char *fmt, ...) va_end(argp); } -static const struct weston_test * +static const struct weston_test_entry * find_test(const char *name) { - const struct weston_test *t; + const struct weston_test_entry *t; for (t = &__start_test_section; t < &__stop_test_section; t++) if (strcmp(t->name, name) == 0) @@ -73,7 +73,7 @@ find_test(const char *name) } static void -run_test(const struct weston_test *t, void *data, int iteration) +run_test(const struct weston_test_entry *t, void *data, int iteration) { char str[512]; @@ -91,7 +91,7 @@ run_test(const struct weston_test *t, void *data, int iteration) static void list_tests(void) { - const struct weston_test *t; + const struct weston_test_entry *t; fprintf(stderr, "Available test names:\n"); for (t = &__start_test_section; t < &__stop_test_section; t++) @@ -100,7 +100,8 @@ list_tests(void) /* iteration is valid only if test_data is not NULL */ static int -exec_and_report_test(const struct weston_test *t, void *test_data, int iteration) +exec_and_report_test(const struct weston_test_entry *t, + void *test_data, int iteration) { int success = 0; int skip = 0; @@ -159,7 +160,7 @@ exec_and_report_test(const struct weston_test *t, void *test_data, int iteration * table_data = NULL. */ static int -iterate_test(const struct weston_test *t, int *passed, int *skipped) +iterate_test(const struct weston_test_entry *t, int *passed, int *skipped) { int ret, i; void *current_test_data = (void *) t->table_data; @@ -177,7 +178,7 @@ iterate_test(const struct weston_test *t, int *passed, int *skipped) int main(int argc, char *argv[]) { - const struct weston_test *t; + const struct weston_test_entry *t; int total = 0; int pass = 0; int skip = 0; diff --git a/tests/weston-test-runner.h b/tests/weston-test-runner.h index 31c15848..6923ad8d 100644 --- a/tests/weston-test-runner.h +++ b/tests/weston-test-runner.h @@ -38,7 +38,7 @@ #error "Tests must not be built with NDEBUG defined, they rely on assert()." #endif -struct weston_test { +struct weston_test_entry { const char *name; void (*run)(void *); const void *table_data; @@ -53,7 +53,7 @@ struct weston_test { #define TEST_COMMON(func, name, ret, data, size, n_elem) \ static void func(void *); \ \ - const struct weston_test test##name \ + const struct weston_test_entry test##name \ __attribute__ ((used, section ("test_section"))) = \ { \ #name, func, data, size, n_elem, ret \