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)
This commit is contained in:
committed by
Luca Boccassi
parent
afb572f06e
commit
c3e01464e7
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user