aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance/cec-compliance.h
diff options
context:
space:
mode:
authorHans Verkuil <hansverk@cisco.com>2018-10-19 14:05:24 +0200
committerHans Verkuil <hansverk@cisco.com>2018-10-19 14:05:24 +0200
commitad47b6e6ef01a9b9d407cd245ea1bf3589df31c7 (patch)
tree51a032b5d35b1d8bec108718412ae2204e7444e3 /utils/cec-compliance/cec-compliance.h
parent53e874d36bc33baf8756999b5c54cbba84ee899a (diff)
cec-compliance: some standby tests should be a warning
Tests were added to check the handling of core messages while the remote device is in standby. After testing with various devices I realized that many of those do not handle this well, causing the compliance test to fail. For now I have turned them into warnings. This might change in the future. I feel that this falls in the category of "it is really a failure, but almost everyone does this", so for the time being a warning is more appropriate. Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Diffstat (limited to 'utils/cec-compliance/cec-compliance.h')
-rw-r--r--utils/cec-compliance/cec-compliance.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 91439fab..0a890311 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -167,13 +167,14 @@ struct node {
unsigned remote_la_mask;
struct remote remote[16];
__u16 phys_addr;
+ bool in_standby;
};
struct remote_subtest {
const char *name;
const __u16 la_mask;
int (*const test_fn)(struct node *node, unsigned me, unsigned la, bool interactive);
- bool needs_pa;
+ bool in_standby;
};
#define PRESUMED_OK 1
@@ -213,14 +214,15 @@ struct remote_subtest {
} \
} while(0)
-#define warn(fmt, args...) \
- do { \
- warnings++; \
- if (show_warnings) \
- printf("\t\twarn: %s(%d): " fmt, __FILE__, __LINE__, ##args); \
- if (exit_on_warn) \
- exit(1); \
- } while (0)
+#define warn(fmt, args...) \
+({ \
+ warnings++; \
+ if (show_warnings) \
+ printf("\t\twarn: %s(%d): " fmt, __FILE__, __LINE__, ##args); \
+ if (exit_on_warn) \
+ exit(1); \
+ 0; \
+})
#define warn_once(fmt, args...) \
do { \
@@ -245,6 +247,15 @@ 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_on_test(test) \
do { \
if (test) \

Privacy Policy