From fd7623193d816ec9e181a37d3f0f1764058edbf7 Mon Sep 17 00:00:00 2001 From: Tanishka Date: Tue, 4 Apr 2023 18:30:31 +0530 Subject: [PATCH] Modified to use STRV_MAKE() in strv_env_name_is_valid() function listed in env-util.c --- src/test/test-env-util.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/test/test-env-util.c b/src/test/test-env-util.c index bcc98ae88ab..8f2293b6c0b 100644 --- a/src/test/test-env-util.c +++ b/src/test/test-env-util.c @@ -479,12 +479,9 @@ TEST(getenv_steal_erase) { } TEST(strv_env_name_is_valid) { - const char *valid_env_names[] = {"HOME", "USER", "SHELL", "PATH", NULL}; - const char *invalid_env_names[] = {"", "PATH", "home", "user", "SHELL", NULL}; - const char *repeated_env_names[] = {"HOME", "USER", "SHELL", "USER", NULL}; - assert_se(strv_env_name_is_valid((char **) valid_env_names)); - assert_se(!strv_env_name_is_valid((char **) invalid_env_names)); - assert_se(!strv_env_name_is_valid((char **) repeated_env_names)); + assert_se(strv_env_name_is_valid(STRV_MAKE("HOME", "USER", "SHELL", "PATH"))); + assert_se(!strv_env_name_is_valid(STRV_MAKE("", "PATH", "home", "user", "SHELL"))); + assert_se(!strv_env_name_is_valid(STRV_MAKE("HOME", "USER", "SHELL", "USER"))); } DEFINE_TEST_MAIN(LOG_DEBUG); -- 2.47.3