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: recognize PRESUMED_OK and REFUSED as ok
Date: Fri, 26 Aug 2016 10:31:48 +0200	[thread overview]
Message-ID: <1472200308-20842-1-git-send-email-jaffe1@gmail.com> (raw)

It is only checked for PRESUMED_OK and REFUSED when performing remote
tests, but these test result codes are also used elsewhere, so checking
for them is moved to the ok function.

Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com>
---
 utils/cec-compliance/cec-compliance.cpp | 9 +++++++--
 utils/cec-compliance/cec-test.cpp       | 4 ----
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
index 519c572..ccfa3ba 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -842,9 +842,14 @@ const char *ok(int res)
 	if (res == NOTSUPPORTED) {
 		strcpy(buf, "OK (Not Supported)");
 		res = 0;
-	} else {
+	} else if (res == PRESUMED_OK) {
+		strcpy(buf, "OK (Presumed)");
+		res = 0;
+	} else if (res == REFUSED) {
+		strcpy(buf, "OK (Refused)");
+		res = 0;
+	} else
 		strcpy(buf, "OK");
-	}
 	tests_total++;
 	if (res) {
 		app_result = res;
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index 5fac04a..07ba4b6 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -1479,10 +1479,6 @@ void testRemote(struct node *node, unsigned me, unsigned la, unsigned test_tags,
 				printf("\t    %s: OK (Unexpected)\n",
 				       tests[i].subtests[j].name);
 			}
-			else if (ret == PRESUMED_OK)
-				printf("\t    %s: OK (Presumed)\n", tests[i].subtests[j].name);
-			else if (ret == REFUSED)
-				printf("\t    %s: OK (Refused)\n", tests[i].subtests[j].name);
 			else if (ret != NOTAPPLICABLE)
 				printf("\t    %s: %s\n", tests[i].subtests[j].name, ok(ret));
 			if (ret == FAIL_CRITICAL)
-- 
2.7.4


                 reply	other threads:[~2016-08-26  8:32 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=1472200308-20842-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.