diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 03:50:42 +0000 |
commit | 78e9bb837c258ac0ec7712b3d612cc2f407e731e (patch) | |
tree | f515d16b6efd858a9aeb5b0ef5d6f90bf288283d /src/test/test-env-file.c | |
parent | Adding debian version 255.5-1. (diff) | |
download | systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.tar.xz systemd-78e9bb837c258ac0ec7712b3d612cc2f407e731e.zip |
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test-env-file.c')
-rw-r--r-- | src/test/test-env-file.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/test/test-env-file.c b/src/test/test-env-file.c index 3fc6d62..f34b2aa 100644 --- a/src/test/test-env-file.c +++ b/src/test/test-env-file.c @@ -65,13 +65,13 @@ TEST(load_env_file_1) { _cleanup_strv_free_ char **data = NULL; assert_se(load_env_file(NULL, name, &data) == 0); - assert_se(streq(data[0], "a=a")); - assert_se(streq(data[1], "b=bc")); - assert_se(streq(data[2], "d=de f")); - assert_se(streq(data[3], "g=g ")); - assert_se(streq(data[4], "h=ąęół śćńźżμ")); - assert_se(streq(data[5], "i=i")); - assert_se(data[6] == NULL); + ASSERT_STREQ(data[0], "a=a"); + ASSERT_STREQ(data[1], "b=bc"); + ASSERT_STREQ(data[2], "d=de f"); + ASSERT_STREQ(data[3], "g=g "); + ASSERT_STREQ(data[4], "h=ąęół śćńźżμ"); + ASSERT_STREQ(data[5], "i=i"); + ASSERT_NULL(data[6]); } TEST(load_env_file_2) { @@ -80,8 +80,8 @@ TEST(load_env_file_2) { _cleanup_strv_free_ char **data = NULL; assert_se(load_env_file(NULL, name, &data) == 0); - assert_se(streq(data[0], "a=a")); - assert_se(data[1] == NULL); + ASSERT_STREQ(data[0], "a=a"); + ASSERT_NULL(data[1]); } TEST(load_env_file_3) { @@ -90,9 +90,9 @@ TEST(load_env_file_3) { _cleanup_strv_free_ char **data = NULL; assert_se(load_env_file(NULL, name, &data) == 0); - assert_se(streq(data[0], "normal1=line111")); - assert_se(streq(data[1], "normal2=line222")); - assert_se(data[2] == NULL); + ASSERT_STREQ(data[0], "normal1=line111"); + ASSERT_STREQ(data[1], "normal2=line222"); + ASSERT_NULL(data[2]); } TEST(load_env_file_4) { @@ -101,10 +101,10 @@ TEST(load_env_file_4) { _cleanup_strv_free_ char **data = NULL; assert_se(load_env_file(NULL, name, &data) == 0); - assert_se(streq(data[0], "HWMON_MODULES=coretemp f71882fg")); - assert_se(streq(data[1], "MODULE_0=coretemp")); - assert_se(streq(data[2], "MODULE_1=f71882fg")); - assert_se(data[3] == NULL); + ASSERT_STREQ(data[0], "HWMON_MODULES=coretemp f71882fg"); + ASSERT_STREQ(data[1], "MODULE_0=coretemp"); + ASSERT_STREQ(data[2], "MODULE_1=f71882fg"); + ASSERT_NULL(data[3]); } TEST(load_env_file_5) { @@ -113,9 +113,9 @@ TEST(load_env_file_5) { _cleanup_strv_free_ char **data = NULL; assert_se(load_env_file(NULL, name, &data) == 0); - assert_se(streq(data[0], "a=")); - assert_se(streq(data[1], "b=")); - assert_se(data[2] == NULL); + ASSERT_STREQ(data[0], "a="); + ASSERT_STREQ(data[1], "b="); + ASSERT_NULL(data[2]); } TEST(load_env_file_6) { @@ -124,11 +124,11 @@ TEST(load_env_file_6) { _cleanup_strv_free_ char **data = NULL; assert_se(load_env_file(NULL, name, &data) == 0); - assert_se(streq(data[0], "a= n t x y '")); - assert_se(streq(data[1], "b=$'")); - assert_se(streq(data[2], "c= \\n\\t\\$\\`\\\\\n")); - assert_se(streq(data[3], "d= \\n\\t$`\\\n")); - assert_se(data[4] == NULL); + ASSERT_STREQ(data[0], "a= n t x y '"); + ASSERT_STREQ(data[1], "b=$'"); + ASSERT_STREQ(data[2], "c= \\n\\t\\$\\`\\\\\n"); + ASSERT_STREQ(data[3], "d= \\n\\t$`\\\n"); + ASSERT_NULL(data[4]); } TEST(load_env_file_invalid_utf8) { @@ -178,13 +178,13 @@ TEST(write_and_load_env_file) { assert_se(f = popen(cmd, "re")); assert_se(read_full_stream(f, &from_shell, &sz) >= 0); assert_se(sz == strlen(v)); - assert_se(streq(from_shell, v)); + ASSERT_STREQ(from_shell, v); assert_se(load_env_file(NULL, p, &l) >= 0); assert_se(strv_equal(l, STRV_MAKE(j))); assert_se(parse_env_file(NULL, p, "TEST", &w) >= 0); - assert_se(streq_ptr(w, v)); + ASSERT_STREQ(w, v); } } |