From f9f9bccba23909492d13b2c71da3281d49f0f8ee Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 22 Dec 2024 16:15:12 +1000 Subject: [PATCH] test: force an unnecessary abort after litest_abort_msg() This is the easy way to get static analyzers to understand that calling litest_abort_msg() always fails. Part-of: --- test/litest.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/litest.h b/test/litest.h index 7d2b1aa0..436698db 100644 --- a/test/litest.h +++ b/test/litest.h @@ -157,9 +157,11 @@ litest_fail_comparison_str(const char *file, #cond, __VA_ARGS__); \ } while(0) -#define litest_abort_msg(...) \ +#define litest_abort_msg(...) {\ litest_fail_condition(__FILE__, __LINE__, __func__, \ "aborting", __VA_ARGS__); \ + abort(); \ +} #define litest_assert_notnull(cond) \ do { \