]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-test: test_run_named*() - use const for tests[] array
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 23 Dec 2016 15:48:19 +0000 (17:48 +0200)
committerGitLab <gitlab@git.dovecot.net>
Fri, 23 Dec 2016 16:30:55 +0000 (18:30 +0200)
src/lib-test/test-common.c
src/lib-test/test-common.h

index 51acaa7555af9bdfdad5df78c95b872e3cda265e..1899dae4f777f3871d1276927f335a7ae1f07944 100644 (file)
@@ -237,7 +237,8 @@ static void test_run_funcs(void (*test_functions[])(void))
                } T_END;
        }
 }
-static void test_run_named_funcs(struct named_test tests[], const char *match)
+static void test_run_named_funcs(const struct named_test tests[],
+                                const char *match)
 {
        unsigned int i;
 
@@ -306,7 +307,7 @@ int test_run(void (*test_functions[])(void))
        test_run_funcs(test_functions);
        return test_deinit();
 }
-int test_run_named(struct named_test tests[], const char *match)
+int test_run_named(const struct named_test tests[], const char *match)
 {
        test_init();
        test_run_named_funcs(tests, match);
@@ -321,8 +322,8 @@ int test_run_with_fatals(void (*test_functions[])(void),
        test_run_fatals(fatal_functions);
        return test_deinit();
 }
-int test_run_named_with_fatals(const char *match, struct named_test tests[],
-                              struct named_fatal fatals[])
+int test_run_named_with_fatals(const char *match, const struct named_test tests[],
+                              const struct named_fatal fatals[])
 {
        test_init();
        test_run_named_funcs(tests, match);
index 5746707d91e1eb916d63ac75b3ce2e98357a301f..1d44c0b6429c52fe43e62b35b485ecce33a15f92 100644 (file)
@@ -57,7 +57,7 @@ struct named_test {
        const char *name;
        void (*func)(void);
 };
-int test_run_named(struct named_test tests[], const char *match);
+int test_run_named(const struct named_test tests[], const char *match);
 
 #define TEST_DECL(x) void x(void);
 #define TEST_NAMELESS(x) x, /* Were you to want to use the X trick but not name the tests */
@@ -80,8 +80,8 @@ struct named_fatal {
 };
 int test_run_with_fatals(void (*test_functions[])(void),
                         test_fatal_func_t *const fatal_functions[]);
-int test_run_named_with_fatals(const char *match, struct named_test tests[],
-                              struct named_fatal fatals[]);
+int test_run_named_with_fatals(const char *match, const struct named_test tests[],
+                              const struct named_fatal fatals[]);
 
 #define FATAL_DECL(x) enum fatal_test_state x(unsigned int);
 #define FATAL_NAMELESS(x) x, /* Were you to want to use the X trick but not name the tests */