]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-xml: migrate to new assertion macros (#37990)
authorYaping Li <202858510+YapingLi04@users.noreply.github.com>
Fri, 27 Jun 2025 18:53:12 +0000 (11:53 -0700)
committerGitHub <noreply@github.com>
Fri, 27 Jun 2025 18:53:12 +0000 (03:53 +0900)
We recently added a new set of assertion macros such as ASSERT_GE,
ASSERT_OK, ASSERT_EQ, ... which show not only the expression that failed
but also the values of the arguments of the expression. Let's use them.

src/test/test-xml.c

index bb9e4c49d0947c7f379e518727bbe6767fd08eb1..b1e102441a2fe725ce51b8c276a16bbc79ad47c3 100644 (file)
@@ -16,12 +16,12 @@ static void test_one(const char *data, ...) {
                 const char *nn;
 
                 t = xml_tokenize(&data, &name, &state, NULL);
-                assert_se(t >= 0);
+                ASSERT_GE(t, 0);
 
                 tt = va_arg(ap, int);
-                assert_se(tt >= 0);
+                ASSERT_GE(tt, 0);
 
-                assert_se(t == tt);
+                ASSERT_EQ(t, tt);
                 if (t == XML_END)
                         break;