summaryrefslogtreecommitdiffstats
path: root/tap/tap.h
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-09-15 13:18:17 +0200
committerGitHub <noreply@github.com>2025-09-15 13:18:17 +0200
commit8ef825d85fb4d09c32ca44c545d6eb8d995ddea4 (patch)
tree5ab7b18797dfd5849dec7827c87ca3bb5fcb0993 /tap/tap.h
parenta3cf9041af810770daf5d9b83f1906fa9bb0dd11 (diff)
parent204cf956f0b3db90d079321ee957b3860da7e33f (diff)
downloadmonitoring-plugins-8ef825d85fb4d09c32ca44c545d6eb8d995ddea4.tar.gz
Merge pull request #2149 from RincewindsHat/clang-format
Clang format
Diffstat (limited to 'tap/tap.h')
-rw-r--r--tap/tap.h43
1 files changed, 24 insertions, 19 deletions
diff --git a/tap/tap.h b/tap/tap.h
index 5abbd76a..0c550bfd 100644
--- a/tap/tap.h
+++ b/tap/tap.h
@@ -28,45 +28,50 @@
28 and requires the caller to add the final comma if they've omitted 28 and requires the caller to add the final comma if they've omitted
29 the optional arguments */ 29 the optional arguments */
30#ifdef __GNUC__ 30#ifdef __GNUC__
31# define ok(e, test, ...) \ 31# define ok(e, test, ...) \
32 ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, test, ##__VA_ARGS__) \ 32 ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, test, ##__VA_ARGS__) \
33 : _gen_result(0, __func__, __FILE__, __LINE__, test, ##__VA_ARGS__)) 33 : _gen_result(0, __func__, __FILE__, __LINE__, test, ##__VA_ARGS__))
34 34
35# define ok1(e) ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) 35# define ok1(e) \
36 ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) \
37 : _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
36 38
37# define pass(test, ...) ok(1, test, ##__VA_ARGS__); 39# define pass(test, ...) ok(1, test, ##__VA_ARGS__);
38# define fail(test, ...) ok(0, test, ##__VA_ARGS__); 40# define fail(test, ...) ok(0, test, ##__VA_ARGS__);
39 41
40# define skip_start(test, n, fmt, ...) \ 42# define skip_start(test, n, fmt, ...) \
41 do { \ 43 do { \
42 if ((test)) { \ 44 if ((test)) { \
43 skip(n, fmt, ##__VA_ARGS__); \ 45 skip(n, fmt, ##__VA_ARGS__); \
44 continue; \ 46 continue; \
45 } 47 }
46#else /* __GNUC__ */ 48#else /* __GNUC__ */
47/* The original tap.h used to test if __STDC_VERSION__ >= 199901L here. This 49/* The original tap.h used to test if __STDC_VERSION__ >= 199901L here. This
48 * doesn't seem to work on HP-UX even though the code compile fine. I'm not 50 * doesn't seem to work on HP-UX even though the code compile fine. I'm not
49 * sure how to add an exception here for HP-UX so I just removed the check 51 * sure how to add an exception here for HP-UX so I just removed the check
50 * for now */ 52 * for now */
51# define ok(e, ...) \ 53# define ok(e, ...) \
52 ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, __VA_ARGS__) : _gen_result(0, __func__, __FILE__, __LINE__, __VA_ARGS__)) 54 ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, __VA_ARGS__) \
55 : _gen_result(0, __func__, __FILE__, __LINE__, __VA_ARGS__))
53 56
54# define ok1(e) ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e)) 57# define ok1(e) \
58 ((e) ? _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) \
59 : _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
55 60
56# define pass(...) ok(1, __VA_ARGS__); 61# define pass(...) ok(1, __VA_ARGS__);
57# define fail(...) ok(0, __VA_ARGS__); 62# define fail(...) ok(0, __VA_ARGS__);
58 63
59# define skip_start(test, n, ...) \ 64# define skip_start(test, n, ...) \
60 do { \ 65 do { \
61 if ((test)) { \ 66 if ((test)) { \
62 skip(n, __VA_ARGS__); \ 67 skip(n, __VA_ARGS__); \
63 continue; \ 68 continue; \
64 } 69 }
65#endif /* __GNUC__ */ 70#endif /* __GNUC__ */
66 71
67#define skip_end \ 72#define skip_end \
68 } \ 73 } \
69 while (0) \ 74 while (0) \
70 ; 75 ;
71 76
72unsigned int _gen_result(int, const char *, char *, unsigned int, char *, ...); 77unsigned int _gen_result(int, const char *, char *, unsigned int, char *, ...);