From: Emil Velikov Date: Fri, 3 Jul 2026 10:50:04 +0000 (+0100) Subject: testsuite: don't use assert_return() for empty testsuite X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=662c125a88dfb81898c60ec96161724af7cdf9be;p=thirdparty%2Fkmod.git testsuite: don't use assert_return() for empty testsuite 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 Link: https://github.com/kmod-project/kmod/pull/375 Signed-off-by: Lucas De Marchi --- diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c index 9f96ef94..57184d16 100644 --- a/testsuite/testsuite.c +++ b/testsuite/testsuite.c @@ -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;