From: Lucas De Marchi Date: Thu, 9 Oct 2014 16:00:30 +0000 (-0300) Subject: Move static keyword to DEFINE_TEST macro X-Git-Tag: v19~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1155c1574b07c1e63cc6a06d51b32bc44bebcc3;p=thirdparty%2Fkmod.git Move static keyword to DEFINE_TEST macro --- diff --git a/testsuite/test-array.c b/testsuite/test-array.c index adf58d7d..3f095d5e 100644 --- a/testsuite/test-array.c +++ b/testsuite/test-array.c @@ -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[] = { diff --git a/testsuite/test-depmod.c b/testsuite/test-depmod.c index ca9633cf..480a3efe 100644 --- a/testsuite/test-depmod.c +++ b/testsuite/test-depmod.c @@ -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", diff --git a/testsuite/test-hash.c b/testsuite/test-hash.c index 236dd72d..70b41262 100644 --- a/testsuite/test-hash.c +++ b/testsuite/test-hash.c @@ -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, diff --git a/testsuite/test-init.c b/testsuite/test-init.c index 06c67d04..8b2419cf 100644 --- a/testsuite/test-init.c +++ b/testsuite/test-init.c @@ -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/", diff --git a/testsuite/test-loaded.c b/testsuite/test-loaded.c index 8f7b449b..bb5f6ad5 100644 --- a/testsuite/test-loaded.c +++ b/testsuite/test-loaded.c @@ -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/", diff --git a/testsuite/test-modinfo.c b/testsuite/test-modinfo.c index 5427cdc0..c5b44a09 100644 --- a/testsuite/test-modinfo.c +++ b/testsuite/test-modinfo.c @@ -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/", diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c index 5bc18f87..1d874cbd 100644 --- a/testsuite/test-modprobe.c +++ b/testsuite/test-modprobe.c @@ -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", diff --git a/testsuite/test-new-module.c b/testsuite/test-new-module.c index 1658422a..8b057d11 100644 --- a/testsuite/test-new-module.c +++ b/testsuite/test-new-module.c @@ -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/", diff --git a/testsuite/test-testsuite.c b/testsuite/test-testsuite.c index 44495c2c..e2b94464 100644 --- a/testsuite/test-testsuite.c +++ b/testsuite/test-testsuite.c @@ -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/", diff --git a/testsuite/test-util.c b/testsuite/test-util.c index e45cac7c..5e4fb0e9 100644 --- a/testsuite/test-util.c +++ b/testsuite/test-util.c @@ -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/", diff --git a/testsuite/testsuite.h b/testsuite/testsuite.h index 930f4af0..ea40e8f4 100644 --- a/testsuite/testsuite.h +++ b/testsuite/testsuite.h @@ -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__ \