aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Fjeldtvedt <jaffe1@gmail.com>2016-08-12 13:59:44 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2016-08-12 14:00:35 +0200
commitb2c4611406e29759d68b7df8d4c970644b434b38 (patch)
tree4ac9727bf23c862ee686fdad3fdb23cf1bb0f2e9
parent5f449c0c4e2d233cbb56623a2c5294ecfbefb5fa (diff)
cec-compliance: add test for invalid operand in SAD request
Check that the device actually replies with Invalid operand when an invalid System Audio Descriptor is requested. Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-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 8126c428..42aa2e47 100644
--- a/utils/cec-compliance/cec-test-audio.cpp
+++ b/utils/cec-compliance/cec-test-audio.cpp
@@ -349,6 +349,28 @@ static int sac_request_sad_probe(struct node *node, unsigned me, unsigned la, bo
return 0;
}
+static int sac_request_sad_invalid(struct node *node, unsigned me, unsigned la, bool interactive)
+{
+ if (!node->remote[la].has_sad)
+ return NOTAPPLICABLE;
+
+ struct cec_msg msg = {};
+ __u8 audio_format_id = CEC_OP_AUD_FMT_ID_CEA861;
+ __u8 audio_format_code = 63; // This is outside the range of CEA861-F
+
+ cec_msg_init(&msg, me, la);
+ cec_msg_request_short_audio_descriptor(&msg, true, 1, &audio_format_id, &audio_format_code);
+ 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] in reply to Request Short\n");
+ warn("Audio Descriptor with invalid audio format as operand.\n");
+ }
+
+ return 0;
+}
+
static int sac_sad_format_check(struct node *node, unsigned me, unsigned la, bool interactive)
{
if (!node->remote[la].has_sad)
@@ -724,6 +746,9 @@ struct remote_subtest sac_subtests[] = {
{ "Request Short Audio Descriptor",
CEC_LOG_ADDR_MASK_AUDIOSYSTEM,
sac_request_sad_probe },
+ { "Request Short Audio Descriptor, invalid",
+ CEC_LOG_ADDR_MASK_AUDIOSYSTEM,
+ sac_request_sad_invalid },
{ "Report Short Audio Descriptor consistency",
CEC_LOG_ADDR_MASK_AUDIOSYSTEM,
sac_sad_format_check },

Privacy Policy