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-strxcpyx.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-strxcpyx.c')
-rw-r--r-- | src/test/test-strxcpyx.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/test/test-strxcpyx.c b/src/test/test-strxcpyx.c index b679522..00f595c 100644 --- a/src/test/test-strxcpyx.c +++ b/src/test/test-strxcpyx.c @@ -24,27 +24,27 @@ TEST(strpcpy) { space_left = strpcpy_full(&s, space_left, "r", &truncated); assert_se(!truncated); assert_se(space_left == 1); - assert_se(streq(target, "12345hey hey heywaldobar")); + ASSERT_STREQ(target, "12345hey hey heywaldobar"); space_left = strpcpy_full(&s, space_left, "", &truncated); assert_se(!truncated); assert_se(space_left == 1); - assert_se(streq(target, "12345hey hey heywaldobar")); + ASSERT_STREQ(target, "12345hey hey heywaldobar"); space_left = strpcpy_full(&s, space_left, "f", &truncated); assert_se(truncated); assert_se(space_left == 0); - assert_se(streq(target, "12345hey hey heywaldobar")); + ASSERT_STREQ(target, "12345hey hey heywaldobar"); space_left = strpcpy_full(&s, space_left, "", &truncated); assert_se(!truncated); assert_se(space_left == 0); - assert_se(streq(target, "12345hey hey heywaldobar")); + ASSERT_STREQ(target, "12345hey hey heywaldobar"); space_left = strpcpy_full(&s, space_left, "foo", &truncated); assert_se(truncated); assert_se(space_left == 0); - assert_se(streq(target, "12345hey hey heywaldobar")); + ASSERT_STREQ(target, "12345hey hey heywaldobar"); } TEST(strpcpyf) { @@ -59,38 +59,38 @@ TEST(strpcpyf) { space_left = strpcpyf_full(&s, space_left, &truncated, "foo%s", "bar"); assert_se(!truncated); assert_se(space_left == 3); - assert_se(streq(target, "space left: 25. foobar")); + ASSERT_STREQ(target, "space left: 25. foobar"); space_left = strpcpyf_full(&s, space_left, &truncated, "%i", 42); assert_se(!truncated); assert_se(space_left == 1); - assert_se(streq(target, "space left: 25. foobar42")); + ASSERT_STREQ(target, "space left: 25. foobar42"); space_left = strpcpyf_full(&s, space_left, &truncated, "%s", ""); assert_se(!truncated); assert_se(space_left == 1); - assert_se(streq(target, "space left: 25. foobar42")); + ASSERT_STREQ(target, "space left: 25. foobar42"); space_left = strpcpyf_full(&s, space_left, &truncated, "%c", 'x'); assert_se(truncated); assert_se(space_left == 0); - assert_se(streq(target, "space left: 25. foobar42")); + ASSERT_STREQ(target, "space left: 25. foobar42"); space_left = strpcpyf_full(&s, space_left, &truncated, "%s", ""); assert_se(!truncated); assert_se(space_left == 0); - assert_se(streq(target, "space left: 25. foobar42")); + ASSERT_STREQ(target, "space left: 25. foobar42"); space_left = strpcpyf_full(&s, space_left, &truncated, "abc%s", "hoge"); assert_se(truncated); assert_se(space_left == 0); - assert_se(streq(target, "space left: 25. foobar42")); + ASSERT_STREQ(target, "space left: 25. foobar42"); /* test overflow */ s = target; space_left = strpcpyf_full(&s, 12, &truncated, "00 left: %i. ", 999); assert_se(truncated); - assert_se(streq(target, "00 left: 99")); + ASSERT_STREQ(target, "00 left: 99"); assert_se(space_left == 0); assert_se(target[12] == '2'); } @@ -107,22 +107,22 @@ TEST(strpcpyl) { space_left = strpcpyl_full(&s, space_left, &truncated, "Banana", NULL); assert_se(!truncated); assert_se(space_left == 1); - assert_se(streq(target, "waldo test waldo. Banana")); + ASSERT_STREQ(target, "waldo test waldo. Banana"); space_left = strpcpyl_full(&s, space_left, &truncated, "", "", "", NULL); assert_se(!truncated); assert_se(space_left == 1); - assert_se(streq(target, "waldo test waldo. Banana")); + ASSERT_STREQ(target, "waldo test waldo. Banana"); space_left = strpcpyl_full(&s, space_left, &truncated, "", "x", "", NULL); assert_se(truncated); assert_se(space_left == 0); - assert_se(streq(target, "waldo test waldo. Banana")); + ASSERT_STREQ(target, "waldo test waldo. Banana"); space_left = strpcpyl_full(&s, space_left, &truncated, "hoge", NULL); assert_se(truncated); assert_se(space_left == 0); - assert_se(streq(target, "waldo test waldo. Banana")); + ASSERT_STREQ(target, "waldo test waldo. Banana"); } TEST(strscpy) { @@ -134,7 +134,7 @@ TEST(strscpy) { space_left = strscpy_full(target, space_left, "12345", &truncated); assert_se(!truncated); - assert_se(streq(target, "12345")); + ASSERT_STREQ(target, "12345"); assert_se(space_left == 20); } @@ -147,7 +147,7 @@ TEST(strscpyl) { space_left = strscpyl_full(target, space_left, &truncated, "12345", "waldo", "waldo", NULL); assert_se(!truncated); - assert_se(streq(target, "12345waldowaldo")); + ASSERT_STREQ(target, "12345waldowaldo"); assert_se(space_left == 10); } @@ -169,7 +169,7 @@ TEST(sd_event_code_migration) { for (i = 0; i < 100; i++) l = strpcpyf(&p, l, "%u ", i); - assert_se(streq(b, c)); + ASSERT_STREQ(b, c); } DEFINE_TEST_MAIN(LOG_INFO); |