aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance/cec-compliance.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-01-21 11:17:44 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-01-21 11:17:44 +0100
commit1b94254fe0c5b80fc907a9de39eb93a187822651 (patch)
tree2578ed5a47bee101e888c8811b4cb511b229b21d /utils/cec-compliance/cec-compliance.h
parentf8c360ae12ee365eede837cd59fd7ccebf92e172 (diff)
cec-compliance.h: add warn_on_test, clean ups
Clean up the macros a bit, add warn_on_test() macro. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/cec-compliance/cec-compliance.h')
-rw-r--r--utils/cec-compliance/cec-compliance.h40
1 files changed, 23 insertions, 17 deletions
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 167738b2..efdf8505 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -197,14 +197,14 @@ struct remote_subtest {
#define COLOR_RED(s) "\033[1;31m" s "\033[0m"
#define COLOR_BOLD(s) "\033[1m" s "\033[0m"
-#define info(fmt, args...) \
- do { \
- if (show_info) \
- printf("\t\tinfo: " fmt, ##args); \
+#define info(fmt, args...) \
+ do { \
+ if (show_info) \
+ printf("\t\tinfo: " fmt, ##args); \
} while (0)
-#define announce(fmt, args...) \
- do { \
+#define announce(fmt, args...) \
+ do { \
printf("\t\t>>> " fmt "\n", ##args); \
} while (0)
@@ -241,6 +241,12 @@ struct remote_subtest {
} \
} while (0)
+#define warn_on_test(test) \
+ do { \
+ if (test) \
+ warn("%s\n", #test); \
+ } while (0)
+
#define fail(fmt, args...) \
({ \
printf("\t\t%s: %s(%d): " fmt, show_colors ? \
@@ -250,19 +256,19 @@ struct remote_subtest {
FAIL; \
})
-#define fail_or_warn(node, fmt, args...) \
-({ \
- if ((node)->in_standby) \
- warn(fmt, ##args); \
- else \
- fail(fmt, ##args); \
- (node)->in_standby ? 0 : FAIL; \
+#define fail_or_warn(node, fmt, args...) \
+({ \
+ if ((node)->in_standby) \
+ warn(fmt, ##args); \
+ else \
+ fail(fmt, ##args); \
+ (node)->in_standby ? 0 : FAIL; \
})
-#define fail_on_test(test) \
- do { \
- if (test) \
- return fail("%s\n", #test); \
+#define fail_on_test(test) \
+ do { \
+ if (test) \
+ return fail("%s\n", #test); \
} while (0)
#define fail_on_test_v2(version, test) fail_on_test(version >= CEC_OP_CEC_VERSION_2_0 && (test))

Privacy Policy