From 1322e205e2066c0da8526bed505dc699d0f5b92a Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Fri, 8 Feb 2019 11:19:04 +0100 Subject: Test: Fixed annoying warnings (and possible obscure bugs). --- test/birdtest.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/birdtest.h') diff --git a/test/birdtest.h b/test/birdtest.h index b2d572d0..dacfb095 100644 --- a/test/birdtest.h +++ b/test/birdtest.h @@ -55,11 +55,13 @@ void bt_log_suite_case_result(int result, const char *fmt, ...); #define BT_PROMPT_FAIL_NO_COLOR " [" "FAIL" "] " #define BT_PROMPT_OK_FAIL_STRLEN 8 /* strlen ' [FAIL] ' */ +static inline int bt_test_fn_noarg(const void *cp) { return ((int (*)(void)) cp)(); } + #define bt_test_suite(fn, dsc, ...) \ bt_test_suite_extra(fn, BT_FORKING, BT_TIMEOUT, dsc, ##__VA_ARGS__) #define bt_test_suite_extra(fn, f, t, dsc, ...) \ - bt_test_suite_base((int (*)(const void *))fn, #fn, NULL, f, t, dsc, ##__VA_ARGS__) + bt_test_suite_base(bt_test_fn_noarg, #fn, fn, f, t, dsc, ##__VA_ARGS__) #define bt_test_suite_arg(fn, arg, dsc, ...) \ bt_test_suite_arg_extra(fn, arg, BT_FORKING, BT_TIMEOUT, dsc, ##__VA_ARGS__) -- cgit v1.2.3