]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: Check return value of underscores()
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 7 Sep 2024 06:19:24 +0000 (01:19 -0500)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 7 Sep 2024 15:13:51 +0000 (10:13 -0500)
Error returned from underscores() shouldn't be ignored.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
testsuite/test-util.c

index 6122999ec3c33720081890ca5a49c32f08c847c2..9c662a209b2d8a8a4cbf29ea08e43d88c22215c8 100644 (file)
@@ -121,7 +121,7 @@ static int test_underscores(const struct test *t)
 
        for (iter = &teststr[0]; iter->val != NULL; iter++) {
                _cleanup_free_ char *val = iter->val;
-               underscores(val);
+               assert_return(!underscores(val), EXIT_FAILURE);
                assert_return(streq(val, iter->res), EXIT_FAILURE);
        }