]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Move static keyword to DEFINE_TEST macro
authorLucas De Marchi <lucas.demarchi@intel.com>
Thu, 9 Oct 2014 16:00:30 +0000 (13:00 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 9 Oct 2014 16:00:30 +0000 (13:00 -0300)
testsuite/test-array.c
testsuite/test-depmod.c
testsuite/test-hash.c
testsuite/test-init.c
testsuite/test-loaded.c
testsuite/test-modinfo.c
testsuite/test-modprobe.c
testsuite/test-new-module.c
testsuite/test-testsuite.c
testsuite/test-util.c
testsuite/testsuite.h

index adf58d7de7e236e0d0a602c82d73f95902ddbdad..3f095d5e14d30d472349ae13204f4ed563615cf6 100644 (file)
@@ -40,7 +40,7 @@ static int test_array_append1(const struct test *t)
 
        return 0;
 }
-static DEFINE_TEST(test_array_append1,
+DEFINE_TEST(test_array_append1,
                .description = "test simple array append");
 
 
@@ -63,7 +63,7 @@ static int test_array_append2(const struct test *t)
 
        return 0;
 }
-static DEFINE_TEST(test_array_append2,
+DEFINE_TEST(test_array_append2,
                .description = "test array append over step");
 
 static int test_array_append_unique(const struct test *t)
@@ -88,7 +88,7 @@ static int test_array_append_unique(const struct test *t)
 
        return 0;
 }
-static DEFINE_TEST(test_array_append_unique,
+DEFINE_TEST(test_array_append_unique,
                .description = "test array append unique");
 
 static int test_array_sort(const struct test *t)
@@ -117,7 +117,7 @@ static int test_array_sort(const struct test *t)
 
        return 0;
 }
-static DEFINE_TEST(test_array_sort,
+DEFINE_TEST(test_array_sort,
                .description = "test array sort");
 
 static int test_array_remove_at(const struct test *t)
@@ -157,7 +157,7 @@ static int test_array_remove_at(const struct test *t)
 
        return 0;
 }
-static DEFINE_TEST(test_array_remove_at,
+DEFINE_TEST(test_array_remove_at,
                .description = "test array remove at");
 
 static const struct test *tests[] = {
index ca9633cfd598d7db5b8f8aee605e81fe15b4c47e..480a3efe0d9a7eb798b64fe6ade95f4f2a74a66c 100644 (file)
@@ -40,7 +40,7 @@ static noreturn int depmod_modules_order_for_compressed(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(depmod_modules_order_for_compressed,
+DEFINE_TEST(depmod_modules_order_for_compressed,
        .description = "check if depmod let aliases in right order when using compressed modules",
        .config = {
                [TC_UNAME_R] = MODULES_ORDER_UNAME,
@@ -66,7 +66,7 @@ static noreturn int depmod_search_order_simple(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(depmod_search_order_simple,
+DEFINE_TEST(depmod_search_order_simple,
        .description = "check if depmod honor search order in config",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -92,7 +92,7 @@ static noreturn int depmod_search_order_same_prefix(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(depmod_search_order_same_prefix,
+DEFINE_TEST(depmod_search_order_same_prefix,
        .description = "check if depmod honor search order in config with same prefix",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -118,7 +118,7 @@ static noreturn int depmod_detect_loop(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(depmod_detect_loop,
+DEFINE_TEST(depmod_detect_loop,
        .description = "check if depmod detects module loops correctly",
        .config = {
                [TC_UNAME_R] = "4.4.4",
index 236dd72d2ea066925cb937d9536565e786a7a902..70b41262b392bfd6c3e7d156074fbc69bb29fde6 100644 (file)
@@ -41,7 +41,7 @@ static int test_hash_new(const struct test *t)
        hash_free(h);
        return 0;
 }
-static DEFINE_TEST(test_hash_new,
+DEFINE_TEST(test_hash_new,
                .description = "test hash_new");
 
 
@@ -60,7 +60,7 @@ static int test_hash_get_count(const struct test *t)
        hash_free(h);
        return 0;
 }
-static DEFINE_TEST(test_hash_get_count,
+DEFINE_TEST(test_hash_get_count,
                .description = "test hash_add / hash_get_count");
 
 
@@ -90,7 +90,7 @@ static int test_hash_replace(const struct test *t)
        hash_free(h);
        return 0;
 }
-static DEFINE_TEST(test_hash_replace,
+DEFINE_TEST(test_hash_replace,
                .description = "test hash_add replacing existing value");
 
 
@@ -121,7 +121,7 @@ static int test_hash_replace_failing(const struct test *t)
        hash_free(h);
        return 0;
 }
-static DEFINE_TEST(test_hash_replace_failing,
+DEFINE_TEST(test_hash_replace_failing,
                .description = "test hash_add_unique failing to replace existing value");
 
 
@@ -155,7 +155,7 @@ static int test_hash_iter(const struct test *t)
        hash_free(h2);
        return 0;
 }
-static DEFINE_TEST(test_hash_iter,
+DEFINE_TEST(test_hash_iter,
                .description = "test hash_iter");
 
 
@@ -191,7 +191,7 @@ static int test_hash_iter_after_del(const struct test *t)
        hash_free(h2);
        return 0;
 }
-static DEFINE_TEST(test_hash_iter_after_del,
+DEFINE_TEST(test_hash_iter_after_del,
                .description = "test hash_iter, after deleting element");
 
 
@@ -217,7 +217,7 @@ static int test_hash_free(const struct test *t)
 
        return 0;
 }
-static DEFINE_TEST(test_hash_free,
+DEFINE_TEST(test_hash_free,
                .description = "test hash_free calling free function for all values");
 static const struct test *tests[] = {
        &stest_hash_new,
index 06c67d04ba009d49a87b4d7d813bbd7bc23c1ba9..8b2419cf8f6e7264f381ae4e3de1b478f5dec18f 100644 (file)
@@ -41,7 +41,7 @@ static noreturn int test_initlib(const struct test *t)
 
        exit(EXIT_SUCCESS);
 }
-static DEFINE_TEST(test_initlib,
+DEFINE_TEST(test_initlib,
                .description = "test if libkmod's init function work");
 
 static noreturn int test_insert(const struct test *t)
@@ -70,7 +70,7 @@ static noreturn int test_insert(const struct test *t)
 
        exit(EXIT_SUCCESS);
 }
-static DEFINE_TEST(test_insert,
+DEFINE_TEST(test_insert,
        .description = "test if libkmod's insert_module returns ok",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-init/",
@@ -105,7 +105,7 @@ static noreturn int test_remove(const struct test *t)
 
        exit(EXIT_SUCCESS);
 }
-static DEFINE_TEST(test_remove,
+DEFINE_TEST(test_remove,
        .description = "test if libkmod's remove_module returns ok",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-remove/",
index 8f7b449b82f682d53c0e28ccabc3a24a1c10a176..bb5f6ad5304fa7b6acbe95a89d800e8e3507cd29 100644 (file)
@@ -79,7 +79,7 @@ static int loaded_1(const struct test *t)
 
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(loaded_1,
+DEFINE_TEST(loaded_1,
        .description = "check if list of module is created",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-loaded/",
index 5427cdc041d9044ef56e697aa1025c4d7cac0773..c5b44a091445852648493b2d8d677f4f8314384d 100644 (file)
@@ -40,7 +40,7 @@ static noreturn int modinfo_jonsmodules(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modinfo_jonsmodules,
+DEFINE_TEST(modinfo_jonsmodules,
        .description = "check if output for modinfo is correct for i686, ppc64, s390x and x86_64",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modinfo/",
index 5bc18f8705dfb112d820388b5d1be850028aa803..1d874cbde83a2cf8573a9404904087cf0c970b6c 100644 (file)
@@ -38,7 +38,7 @@ static noreturn int modprobe_show_depends(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_show_depends,
+DEFINE_TEST(modprobe_show_depends,
        .description = "check if output for modprobe --show-depends is correct for loaded modules",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -60,7 +60,7 @@ static noreturn int modprobe_show_depends2(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_show_depends2,
+DEFINE_TEST(modprobe_show_depends2,
        .description = "check if output for modprobe --show-depends is correct",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -83,7 +83,7 @@ static noreturn int modprobe_show_alias_to_none(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_show_alias_to_none,
+DEFINE_TEST(modprobe_show_alias_to_none,
        .description = "check if modprobe --show-depends doesn't explode with an alias to nothing",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -108,7 +108,7 @@ static noreturn int modprobe_builtin(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_builtin,
+DEFINE_TEST(modprobe_builtin,
        .description = "check if modprobe return 0 for builtin",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -127,7 +127,7 @@ static noreturn int modprobe_softdep_loop(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_softdep_loop,
+DEFINE_TEST(modprobe_softdep_loop,
        .description = "check if modprobe breaks softdep loop",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -149,7 +149,7 @@ static noreturn int modprobe_install_cmd_loop(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_install_cmd_loop,
+DEFINE_TEST(modprobe_install_cmd_loop,
        .description = "check if modprobe breaks install-commands loop",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -175,7 +175,7 @@ static noreturn int modprobe_param_kcmdline(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_param_kcmdline,
+DEFINE_TEST(modprobe_param_kcmdline,
        .description = "check if params from kcmdline are passed in fact passed to (f)init_module call",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -199,7 +199,7 @@ static noreturn int modprobe_param_kcmdline2(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_param_kcmdline2,
+DEFINE_TEST(modprobe_param_kcmdline2,
        .description = "check if params with no value are parsed correctly from kcmdline",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -223,7 +223,7 @@ static noreturn int modprobe_param_kcmdline3(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_param_kcmdline3,
+DEFINE_TEST(modprobe_param_kcmdline3,
        .description = "check if unrelated strings in kcmdline are correctly ignored",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -247,7 +247,7 @@ static noreturn int modprobe_param_kcmdline4(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_param_kcmdline4,
+DEFINE_TEST(modprobe_param_kcmdline4,
        .description = "check if unrelated strings in kcmdline are correctly ignored",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -271,7 +271,7 @@ static noreturn int modprobe_force(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_force,
+DEFINE_TEST(modprobe_force,
        .description = "check modprobe --force",
        .config = {
                [TC_UNAME_R] = "4.4.4",
@@ -293,7 +293,7 @@ static noreturn int modprobe_oldkernel(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_oldkernel,
+DEFINE_TEST(modprobe_oldkernel,
        .description = "check modprobe --force",
        .config = {
                [TC_UNAME_R] = "3.3.3",
@@ -315,7 +315,7 @@ static noreturn int modprobe_oldkernel_force(const struct test *t)
        test_spawn_prog(progname, args);
        exit(EXIT_FAILURE);
 }
-static DEFINE_TEST(modprobe_oldkernel_force,
+DEFINE_TEST(modprobe_oldkernel_force,
        .description = "check modprobe --force",
        .config = {
                [TC_UNAME_R] = "3.3.3",
index 1658422abcbb59c85d3d571d32f8c111ec6ca17e..8b057d119a42fa660ad772a6413ebab4fafc13dc 100644 (file)
@@ -61,7 +61,7 @@ static int from_name(const struct test *t)
 
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(from_name,
+DEFINE_TEST(from_name,
        .description = "check if module names are parsed correctly",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-new-module/from_name/",
@@ -106,7 +106,7 @@ static int from_alias(const struct test *t)
 
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(from_alias,
+DEFINE_TEST(from_alias,
        .description = "check if aliases are parsed correctly",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-new-module/from_alias/",
index 44495c2cbb40b824097ad7383e493491ce3a0702..e2b94464e914ce03b9d62a64524fa47fcf39e9ce 100644 (file)
@@ -50,7 +50,7 @@ static noreturn int testsuite_uname(const struct test *t)
 
        exit(EXIT_SUCCESS);
 }
-static DEFINE_TEST(testsuite_uname,
+DEFINE_TEST(testsuite_uname,
        .description = "test if trap to uname() works",
        .config = {
                [TC_UNAME_R] = TEST_UNAME,
@@ -76,7 +76,7 @@ static int testsuite_rootfs_fopen(const struct test *t)
 
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(testsuite_rootfs_fopen,
+DEFINE_TEST(testsuite_rootfs_fopen,
        .description = "test if rootfs works - fopen()",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-rootfs/",
@@ -109,7 +109,7 @@ static int testsuite_rootfs_open(const struct test *t)
 
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(testsuite_rootfs_open,
+DEFINE_TEST(testsuite_rootfs_open,
        .description = "test if rootfs works - open()",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-rootfs/",
@@ -132,7 +132,7 @@ static int testsuite_rootfs_stat_access(const struct test *t)
 
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(testsuite_rootfs_stat_access,
+DEFINE_TEST(testsuite_rootfs_stat_access,
        .description = "test if rootfs works - stat() and access()",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-rootfs/",
@@ -152,7 +152,7 @@ static int testsuite_rootfs_opendir(const struct test *t)
        closedir(d);
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(testsuite_rootfs_opendir,
+DEFINE_TEST(testsuite_rootfs_opendir,
        .description = "test if rootfs works - opendir()",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-rootfs/",
index e45cac7c031057a0661df2f1682aa1c9947fefd4..5e4fb0e99f9520c9be6880a17060756febdc1d46 100644 (file)
@@ -57,7 +57,7 @@ static int alias_1(const struct test *t)
 
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(alias_1,
+DEFINE_TEST(alias_1,
        .description = "check if alias_normalize does the right thing",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-util/",
@@ -87,7 +87,7 @@ static int test_freadline_wrapped(const struct test *t)
        fclose(fp);
        return EXIT_SUCCESS;
 }
-static DEFINE_TEST(test_freadline_wrapped,
+DEFINE_TEST(test_freadline_wrapped,
        .description = "check if freadline_wrapped() does the right thing",
        .config = {
                [TC_ROOTFS] = TESTSUITE_ROOTFS "test-util/",
index 930f4af0f97b2e5dd12f5cb553367b4fae19cdae..ea40e8f48a20bfa4b7e389d658171454d106f17f 100644 (file)
@@ -131,7 +131,7 @@ int test_run(const struct test *t);
 
 /* Test definitions */
 #define DEFINE_TEST(_name, ...) \
-       const struct test s##_name = { \
+       static const struct test s##_name = { \
                .name = #_name, \
                .func = _name, \
                ## __VA_ARGS__ \