From a328473b3f36aee88dcf91d0705178f7bf9823af Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 26 May 2026 14:52:59 +0000 Subject: [PATCH] tests/custom-env-test: migrate to DECLARE_TEST_LIST API Replace TEST() and TEST_P() macros with explicit static functions and DECLARE_TEST_LIST() registration for better type safety and to prepare for removing the custom ELF section. Co-authored-by: Claude Sonnet 4.6 Signed-off-by: Pekka Paalanen --- tests/custom-env-test.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/custom-env-test.c b/tests/custom-env-test.c index 0cbebd0b5..7efdfbbef 100644 --- a/tests/custom-env-test.c +++ b/tests/custom-env-test.c @@ -75,7 +75,8 @@ DECLARE_FIXTURE_SETUP(setup_env); #define DEFAULT_ENVP (char * const []) { "ENV1=one", "ENV2=two", "ENV3=three", NULL } -TEST(basic_env) +static enum test_result_code +basic_env(struct wet_testsuite_data *suite_data) { struct custom_env env; char *const envp[] = { "ENV1=one", "ENV2=two", "ENV3=four", "ENV5=five", NULL }; @@ -90,7 +91,8 @@ TEST(basic_env) return RESULT_OK; } -TEST(basic_env_arg) +static enum test_result_code +basic_env_arg(struct wet_testsuite_data *suite_data) { struct custom_env env; char *const argp[] = { "arg1", "arg2", "arg3", NULL }; @@ -148,10 +150,11 @@ static const struct test_str str_tests[] = { }, }; -TEST_P(env_parse_string, str_tests) +static enum test_result_code +env_parse_string(struct wet_testsuite_data *suite_data, + const struct test_str *test) { struct custom_env env; - const struct test_str *test = data; testlog("checking exec_str '%s'\n", test->exec_str); custom_env_init_from_environ(&env); @@ -162,3 +165,9 @@ TEST_P(env_parse_string, str_tests) return RESULT_OK; } + +DECLARE_TEST_LIST( + TESTFN(basic_env), + TESTFN(basic_env_arg), + TESTFN_ARG(env_parse_string, str_tests), +);