diff options
author | Ivan Kruglov <mail@ikruglov.com> | 2024-04-10 13:19:39 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-04-15 08:13:50 +0200 |
commit | c79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a (patch) | |
tree | 88c426bab7e104bc11ff4289e878bb676c083a9a /src/test/test-ellipsize.c | |
parent | Merge pull request #32266 from yuwata/libsystemd-network-trivial-cleanups (diff) | |
download | systemd-c79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a.tar.xz systemd-c79e88b37d3f8b94cdd2aeba1edbe09d06c08f7a.zip |
ASSERT_STREQ for simple cases
Diffstat (limited to 'src/test/test-ellipsize.c')
-rw-r--r-- | src/test/test-ellipsize.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test-ellipsize.c b/src/test/test-ellipsize.c index c272c561d2..f1814768fd 100644 --- a/src/test/test-ellipsize.c +++ b/src/test/test-ellipsize.c @@ -57,9 +57,9 @@ static void test_ellipsize_mem_one(const char *s, size_t old_length, size_t new_ assert_se(utf8_console_width(t3) <= max_width); if (new_length >= old_length) { - assert_se(streq(t1, n)); - assert_se(streq(t2, n)); - assert_se(streq(t3, n)); + ASSERT_STREQ(t1, n); + ASSERT_STREQ(t2, n); + ASSERT_STREQ(t3, n); } } @@ -143,17 +143,17 @@ TEST(ellipsize_ansi_cats) { e = ellipsize("01" ANSI_NORMAL "23", 4, 0); puts(e); - assert_se(streq(e, "01" ANSI_NORMAL "23")); + ASSERT_STREQ(e, "01" ANSI_NORMAL "23"); f = ellipsize("ab" ANSI_NORMAL "cd", 4, 90); puts(f); - assert_se(streq(f, "ab" ANSI_NORMAL "cd")); + ASSERT_STREQ(f, "ab" ANSI_NORMAL "cd"); g = ellipsize("🐱🐱" ANSI_NORMAL "🐱🐱" ANSI_NORMAL, 5, 0); puts(g); - assert_se(streq(g, "…" ANSI_NORMAL "🐱🐱" ANSI_NORMAL)); + ASSERT_STREQ(g, "…" ANSI_NORMAL "🐱🐱" ANSI_NORMAL); h = ellipsize("🐱🐱" ANSI_NORMAL "🐱🐱" ANSI_NORMAL, 5, 90); puts(h); - assert_se(streq(h, "🐱…" ANSI_NORMAL "🐱" ANSI_NORMAL)); + ASSERT_STREQ(h, "🐱…" ANSI_NORMAL "🐱" ANSI_NORMAL); } DEFINE_TEST_MAIN(LOG_INFO); |