test: util: Introduce fail_args()

This macro is very similar to fail() but supports variable number of
arguments to print format strings.

Signed-off-by: Phil Sutter <psutter@redhat.com>
This commit is contained in:
Phil Sutter 2019-02-25 12:49:58 +01:00
parent c882db1056
commit c3628e1f4d
1 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,13 @@
exit(1); \
} while (0)
#define fail_args(msg, ...) \
do { \
failhdr; \
fprintf(stderr, msg "\n", __VA_ARGS__); \
exit(1); \
} while(0)
/* Assumes json_error_t error */
#define check_errors(code_, texts_, num_, source_, line_, column_, position_) \
do { \