summaryrefslogtreecommitdiffstats
path: root/src/test/test-proc-cmdline.c
diff options
context:
space:
mode:
authorIvan Kruglov <mail@ikruglov.com>2024-04-10 13:19:39 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-15 08:13:50 +0200
commitc79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a (patch)
tree88c426bab7e104bc11ff4289e878bb676c083a9a /src/test/test-proc-cmdline.c
parentMerge pull request #32266 from yuwata/libsystemd-network-trivial-cleanups (diff)
downloadsystemd-c79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a.tar.xz
systemd-c79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a.zip
ASSERT_STREQ for simple cases
Diffstat (limited to 'src/test/test-proc-cmdline.c')
-rw-r--r--src/test/test-proc-cmdline.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/test/test-proc-cmdline.c b/src/test/test-proc-cmdline.c
index 8b5bbb079e..420f312636 100644
--- a/src/test/test-proc-cmdline.c
+++ b/src/test/test-proc-cmdline.c
@@ -37,7 +37,7 @@ TEST(proc_cmdline_override) {
/* First test if the overrides for /proc/cmdline still work */
assert_se(proc_cmdline(&line) >= 0);
- assert_se(streq(line, "foo_bar=quux wuff-piep=tuet zumm some_arg_with_space='foo bar' and_one_more=\"zzz aaa\""));
+ ASSERT_STREQ(line, "foo_bar=quux wuff-piep=tuet zumm some_arg_with_space='foo bar' and_one_more=\"zzz aaa\"");
line = mfree(line);
assert_se(proc_cmdline_strv(&args) >= 0);
assert_se(strv_equal(args, STRV_MAKE("foo_bar=quux", "wuff-piep=tuet", "zumm", "some_arg_with_space=foo bar", "and_one_more=zzz aaa")));
@@ -57,7 +57,7 @@ TEST(proc_cmdline_override) {
assert_se(putenv((char*) "SYSTEMD_EFI_OPTIONS=foo_bar=quux wuff-piep=tuet zumm some_arg_with_space='foo bar' and_one_more=\"zzz aaa\"") == 0);
assert_se(proc_cmdline(&line) >= 0);
- assert_se(streq(line, "hoge"));
+ ASSERT_STREQ(line, "hoge");
line = mfree(line);
assert_se(proc_cmdline_strv(&args) >= 0);
assert_se(strv_equal(args, STRV_MAKE("hoge")));
@@ -83,13 +83,13 @@ static int parse_item_given(const char *key, const char *value, void *data) {
log_info("%s: option <%s> = <%s>", __func__, key, strna(value));
if (proc_cmdline_key_streq(key, "foo_bar"))
- assert_se(streq(value, "quux"));
+ ASSERT_STREQ(value, "quux");
else if (proc_cmdline_key_streq(key, "wuff-piep"))
- assert_se(streq(value, "tuet "));
+ ASSERT_STREQ(value, "tuet ");
else if (proc_cmdline_key_streq(key, "space"))
- assert_se(streq(value, "x y z"));
+ ASSERT_STREQ(value, "x y z");
else if (proc_cmdline_key_streq(key, "miepf"))
- assert_se(streq(value, "uuu"));
+ ASSERT_STREQ(value, "uuu");
else if (in_initrd() && *strip && proc_cmdline_key_streq(key, "zumm"))
assert_se(!value);
else if (in_initrd() && !*strip && proc_cmdline_key_streq(key, "rd.zumm"))
@@ -231,13 +231,13 @@ TEST(proc_cmdline_get_key_many) {
"doubleticks", &value6,
"zummm", &value7) == 5);
- assert_se(streq_ptr(value1, "quux"));
+ ASSERT_STREQ(value1, "quux");
assert_se(!value2);
- assert_se(streq_ptr(value3, "tuet"));
+ ASSERT_STREQ(value3, "tuet");
assert_se(!value4);
- assert_se(streq_ptr(value5, "one two"));
- assert_se(streq_ptr(value6, " aaa aaa "));
- assert_se(streq_ptr(value7, "\n"));
+ ASSERT_STREQ(value5, "one two");
+ ASSERT_STREQ(value6, " aaa aaa ");
+ ASSERT_STREQ(value7, "\n");
}
TEST(proc_cmdline_key_streq) {