From 00cbf8bcca9d047eead535ebd5bc986365b04426 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:24:53 +0100 Subject: tap: clang-format --- tap/tap.h | 60 +++++++++++++++++++++++++++--------------------------------- 1 file changed, 27 insertions(+), 33 deletions(-) (limited to 'tap/tap.h') diff --git a/tap/tap.h b/tap/tap.h index 8ee525c8..5abbd76a 100644 --- a/tap/tap.h +++ b/tap/tap.h @@ -28,52 +28,46 @@ and requires the caller to add the final comma if they've omitted the optional arguments */ #ifdef __GNUC__ -# define ok(e, test, ...) ((e) ? \ - _gen_result(1, __func__, __FILE__, __LINE__, \ - test, ## __VA_ARGS__) : \ - _gen_result(0, __func__, __FILE__, __LINE__, \ - test, ## __VA_ARGS__)) +# define ok(e, test, ...) \ + ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, test, ##__VA_ARGS__) \ + : _gen_result(0, __func__, __FILE__, __LINE__, test, ##__VA_ARGS__)) -# define ok1(e) ((e) ? \ - _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \ - _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) +# define ok1(e) ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) -# define pass(test, ...) ok(1, test, ## __VA_ARGS__); -# define fail(test, ...) ok(0, test, ## __VA_ARGS__); +# define pass(test, ...) ok(1, test, ##__VA_ARGS__); +# define fail(test, ...) ok(0, test, ##__VA_ARGS__); -# define skip_start(test, n, fmt, ...) \ - do { \ - if((test)) { \ - skip(n, fmt, ## __VA_ARGS__); \ - continue; \ - } +# define skip_start(test, n, fmt, ...) \ + do { \ + if ((test)) { \ + skip(n, fmt, ##__VA_ARGS__); \ + continue; \ + } #else /* __GNUC__ */ /* The original tap.h used to test if __STDC_VERSION__ >= 199901L here. This * doesn't seem to work on HP-UX even though the code compile fine. I'm not * sure how to add an exception here for HP-UX so I just removed the check * for now */ -# define ok(e, ...) ((e) ? \ - _gen_result(1, __func__, __FILE__, __LINE__, \ - __VA_ARGS__) : \ - _gen_result(0, __func__, __FILE__, __LINE__, \ - __VA_ARGS__)) +# define ok(e, ...) \ + ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, __VA_ARGS__) : _gen_result(0, __func__, __FILE__, __LINE__, __VA_ARGS__)) -# define ok1(e) ((e) ? \ - _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \ - _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) +# define ok1(e) ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) -# define pass(...) ok(1, __VA_ARGS__); -# define fail(...) ok(0, __VA_ARGS__); +# define pass(...) ok(1, __VA_ARGS__); +# define fail(...) ok(0, __VA_ARGS__); -# define skip_start(test, n, ...) \ - do { \ - if((test)) { \ - skip(n, __VA_ARGS__); \ - continue; \ - } +# define skip_start(test, n, ...) \ + do { \ + if ((test)) { \ + skip(n, __VA_ARGS__); \ + continue; \ + } #endif /* __GNUC__ */ -# define skip_end } while(0); +#define skip_end \ + } \ + while (0) \ + ; unsigned int _gen_result(int, const char *, char *, unsigned int, char *, ...); -- cgit v1.2.3-74-g34f1