tests: rename struct weston_test to weston_test_entry
authorPekka Paalanen <pekka.paalanen@collabora.com>
Thu, 7 Nov 2019 11:34:59 +0000 (13:34 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.com>
Fri, 22 Nov 2019 10:54:51 +0000 (12:54 +0200)
This avoids confusing it with the opaque struct weston_test from
protocol/weston-test.xml.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
tests/weston-test-runner.c
tests/weston-test-runner.h

index c269b69fae206a0b950b0333dd23ce41acf96f73..5e1585afa33f161056145df2c1a96cebdec65784 100644 (file)
@@ -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;
index 31c15848a0e3627ee3dfe8c6fd76ee4890326be4..6923ad8d9af7615eadee067247b51becebf91871 100644 (file)
@@ -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                    \