]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: don't use assert_return() for empty testsuite
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 3 Jul 2026 10:50:04 +0000 (11:50 +0100)
committerLucas De Marchi <ldemarchi@kernel.org>
Thu, 16 Jul 2026 02:19:53 +0000 (23:19 -0300)
With follow-up commit we'll rework/remove the macro, where the new
version does not allow for providing the return value.

Swap it for a manual ERR, printing a more useful error message.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/375
Signed-off-by: Lucas De Marchi <ldemarchi@kernel.org>
testsuite/testsuite.c

index 9f96ef944002dcf6d057a48b5a592b07df19dce5..57184d1690817c1c1d8f8b63d04e612a7b54cdab 100644 (file)
@@ -83,7 +83,10 @@ int test_init(const struct test *start, const struct test *stop, int argc,
        progname = argv[0];
 
        /* An empty testsuite is not likely intended */
-       assert_return(start != stop, -EINVAL);
+       if (start == stop) {
+               ERR("Empty testsuite found. Did the compiler toolchain discard them?\n");
+               return -EINVAL;
+       }
 
        for (;;) {
                int c, idx = 0;