From c3e01464e7c362a807420fb3205da0d14b075f9e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 9 Oct 2026 19:07:01 +0200 Subject: [PATCH] test-parse-helpers: use ASSERT_STREQ()/ASSERT_EQ() in test_path_simplify_and_warn_one() Tests exist to test stuff, hence we should not use plain assert(), but the ASSERT_XYZ() macros, which are never compiled out and print useful information on failure. (cherry picked from commit 13bf80491bcf8ffee2b43cf86b16e3d1394300ef) --- src/test/test-parse-helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/test-parse-helpers.c b/src/test/test-parse-helpers.c index 041d381654..5b68ab566c 100644 --- a/src/test/test-parse-helpers.c +++ b/src/test/test-parse-helpers.c @@ -96,15 +96,15 @@ static int test_path_simplify_and_warn_one(const char *p, const char *q, PathSim int a, b; a = path_simplify_and_warn(s, f, /* unit= */ NULL, /* filename= */ NULL, /* line= */ 0, "Foobar="); - assert(streq_ptr(s, q)); + ASSERT_STREQ(s, q); free(s); s = ASSERT_PTR(strdup(p)); b = path_simplify_and_warn(s, f|PATH_CHECK_FATAL, /* unit= */ NULL, /* filename= */ NULL, /* line= */ 0, "Foobar="); - assert(streq_ptr(s, q)); + ASSERT_STREQ(s, q); - assert(a == b); + ASSERT_EQ(a, b); return a; }