All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Fjeldtvedt <jaffe1@gmail.com>
To: linux-media@vger.kernel.org
Cc: Johan Fjeldtvedt <jaffe1@gmail.com>
Subject: [PATCH] cec-compliance: fix Device OSD Transfer tests
Date: Wed, 24 Aug 2016 12:24:05 +0200	[thread overview]
Message-ID: <1472034245-13683-1-git-send-email-jaffe1@gmail.com> (raw)

Remove a check for whether the first Set OSD String test applies, since this
test itself is used to determine whether the others apply. This bug
caused the tests to never be run.

Also fix the test for Set OSD String where the default display control
operand is given. In this case, when in interactive mode, we should wait for
at least 20 s and ask the user if there was any change (according to the CEC
1.4b CTS).

Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com>
---
 utils/cec-compliance/cec-test.cpp | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index 5fac04a..20d818f 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -354,16 +354,13 @@ static struct remote_subtest device_osd_transfer_subtests[] = {
 
 static int osd_string_set_default(struct node *node, unsigned me, unsigned la, bool interactive)
 {
-	if (!node->remote[la].has_osd)
-		return NOTAPPLICABLE;
-
 	struct cec_msg msg = { };
 	char osd[14];
 	bool unsuitable = false;
 
 	sprintf(osd, "Rept %x from %x", la, me);
 
-	interactive_info(true, "You should see \"%s\" appear on the screen for approximately one second.", osd);
+	interactive_info(true, "You should see \"%s\" appear on the screen", osd);
 	cec_msg_init(&msg, me, la);
 	cec_msg_set_osd_string(&msg, CEC_OP_DISP_CTL_DEFAULT, osd);
 	fail_on_test(!transmit_timeout(node, &msg));
@@ -380,18 +377,17 @@ static int osd_string_set_default(struct node *node, unsigned me, unsigned la, b
 		warn("The device is in an unsuitable state or cannot display the complete message.\n");
 		unsuitable = true;
 	}
-
-	cec_msg_init(&msg, me, la);
-	cec_msg_set_osd_string(&msg, CEC_OP_DISP_CTL_CLEAR, "");
-	fail_on_test(!transmit_timeout(node, &msg, 250));
-	fail_on_test(cec_msg_status_is_abort(&msg));
-	fail_on_test(!unsuitable && interactive && !question("Did the string appear?"));
-
 	node->remote[la].has_osd = true;
-	if (interactive)
-		return 0;
-	else
+	if (!interactive)
 		return PRESUMED_OK;
+
+	/* The CEC 1.4b CTS specifies that one should wait at least 20 seconds for the
+	   string to be cleared on the remote device */
+	interactive_info(true, "Waiting 20s for OSD string to be cleared on the remote device");
+	sleep(20);
+	fail_on_test(!unsuitable && interactive && !question("Did the string appear and then disappear?"));
+
+	return 0;
 }
 
 static int osd_string_set_until_clear(struct node *node, unsigned me, unsigned la, bool interactive)
@@ -411,7 +407,7 @@ static int osd_string_set_until_clear(struct node *node, unsigned me, unsigned l
 	cec_msg_init(&msg, me, la);
 	cec_msg_set_osd_string(&msg, CEC_OP_DISP_CTL_UNTIL_CLEARED, osd);
 	fail_on_test(!transmit(node, &msg));
-	if (cec_msg_status_is_abort(&msg) && abort_reason(&msg) != CEC_OP_ABORT_UNRECOGNIZED_OP) {
+	if (cec_msg_status_is_abort(&msg) && !unrecognized_op(&msg)) {
 		warn("The device is in an unsuitable state or cannot display the complete message.\n");
 		unsuitable = true;
 	}
-- 
2.7.4


                 reply	other threads:[~2016-08-24 10:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472034245-13683-1-git-send-email-jaffe1@gmail.com \
    --to=jaffe1@gmail.com \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.