aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance/cec-test-audio.cpp
diff options
context:
space:
mode:
authorDeborah Brouwer <deborahbrouwer3563@gmail.com>2021-04-21 20:27:54 -0700
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-04-22 08:54:13 +0200
commit1ab369e80c6c313c15218f0b55174a81a8a82d19 (patch)
tree2d4d2ed2c4a75d2388a62454bc8ba07bb9246300 /utils/cec-compliance/cec-test-audio.cpp
parent82a21f594712395d46145fb3ccc397047f74c99e (diff)
cec: add invalid operand test for Audio Rate Control messages
Add a test in cec-compliance that sends an Audio Rate Control message with an invalid operand. Check that it receives a Feature Abort reply due to the invalid operand. Add a response in cec-follower to Feature Abort due to an invalid operand. Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/cec-compliance/cec-test-audio.cpp')
-rw-r--r--utils/cec-compliance/cec-test-audio.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/utils/cec-compliance/cec-test-audio.cpp b/utils/cec-compliance/cec-test-audio.cpp
index e1386dbb..bdbcd178 100644
--- a/utils/cec-compliance/cec-test-audio.cpp
+++ b/utils/cec-compliance/cec-test-audio.cpp
@@ -895,6 +895,25 @@ static int audio_rate_ctl_active_sensing(struct node *node, unsigned me, unsigne
return OK_PRESUMED;
}
+static int audio_rate_ctl_invalid(struct node *node, unsigned me, unsigned la, bool interactive)
+{
+ if (!node->remote[la].has_aud_rate)
+ return NOTAPPLICABLE;
+
+ struct cec_msg msg = {};
+
+ cec_msg_init(&msg, me, la);
+ cec_msg_set_audio_rate(&msg, 0xa); /* Invalid Audio Rate Control message operand */
+ fail_on_test(!transmit_timeout(node, &msg));
+ fail_on_test(timed_out(&msg));
+ fail_on_test(!cec_msg_status_is_abort(&msg));
+ if (abort_reason(&msg) != CEC_OP_ABORT_INVALID_OP) {
+ warn("Expected Feature Abort [Invalid operand]\n");
+ return FAIL;
+ }
+ return OK;
+}
+
const vec_remote_subtests audio_rate_ctl_subtests{
{
"Set Audio Rate",
@@ -908,4 +927,10 @@ const vec_remote_subtests audio_rate_ctl_subtests{
CEC_LOG_ADDR_MASK_TUNER | CEC_LOG_ADDR_MASK_AUDIOSYSTEM,
audio_rate_ctl_active_sensing,
},
+ {
+ "Audio Rate Invalid Operand",
+ CEC_LOG_ADDR_MASK_PLAYBACK | CEC_LOG_ADDR_MASK_RECORD |
+ CEC_LOG_ADDR_MASK_TUNER | CEC_LOG_ADDR_MASK_AUDIOSYSTEM,
+ audio_rate_ctl_invalid,
+ },
};

Privacy Policy