aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-03-20 12:31:30 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-03-20 12:31:30 +0100
commitd5aa09b5c9874df226bd3f1d271c4a17e645b5eb (patch)
tree157c432037bc023a146ad21482700a807d15d476
parentfa0e9cde7e847601b550868e535965ea058b68ab (diff)
cec-compliance: check for invalid transient power states
Check in poll_stable_power_status() if the transient power state is correct, i.e. if you got from STANDBY to ON, then the transient state should be TO_ON, not TO_STANDBY. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-compliance/cec-compliance.h6
-rw-r--r--utils/cec-compliance/cec-test-power.cpp4
2 files changed, 10 insertions, 0 deletions
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 39a5402f..f50ea483 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -248,6 +248,12 @@ struct remote_subtest {
warn("%s\n", #test); \
} while (0)
+#define warn_once_on_test(test) \
+ do { \
+ if (test) \
+ warn_once("%s\n", #test); \
+ } while (0)
+
#define fail(fmt, args...) \
({ \
printf("\t\t%s: %s(%d): " fmt, show_colors ? \
diff --git a/utils/cec-compliance/cec-test-power.cpp b/utils/cec-compliance/cec-test-power.cpp
index 9b4ca856..90a62ddc 100644
--- a/utils/cec-compliance/cec-test-power.cpp
+++ b/utils/cec-compliance/cec-test-power.cpp
@@ -309,6 +309,10 @@ static bool poll_stable_power_status(struct node *node, unsigned me, unsigned la
power_status == CEC_OP_POWER_STATUS_TO_STANDBY)) {
time_to_transient = time(NULL) - t;
transient = true;
+ warn_once_on_test(expected_status == CEC_OP_POWER_STATUS_ON &&
+ power_status == CEC_OP_POWER_STATUS_TO_STANDBY);
+ warn_once_on_test(expected_status == CEC_OP_POWER_STATUS_STANDBY &&
+ power_status == CEC_OP_POWER_STATUS_TO_ON);
}
if (power_status == expected_status) {
announce("Transient state after %d s, stable state %s after %d s",

Privacy Policy