From: Tanishka Date: Tue, 4 Apr 2023 13:00:31 +0000 (+0530) Subject: Modified to use STRV_MAKE() in strv_env_name_is_valid() function listed in env-util.c X-Git-Tag: v254-rc1~755 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd7623193d816ec9e181a37d3f0f1764058edbf7;p=thirdparty%2Fsystemd.git Modified to use STRV_MAKE() in strv_env_name_is_valid() function listed in env-util.c --- 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);