Skip to contentSkip to conversation

cec-compliance: recognize PRESUMED_OK and REFUSED as ok

PATCH New Johan Fjeldtvedt 1 participant 1 message Aug 26, 2016 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cec-compliance: recognize PRESUMED_OK and REFUSED as ok

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.

---
 utils/cec-compliance/cec-compliance.cpp | 9 +++++++--
 utils/cec-compliance/cec-test.cpp       | 4 ----
 2 files changed, 7 insertions(+), 6 deletions(-)
utils/cec-compliance/cec-compliance.cpp +7 -2
index 519c572..ccfa3ba 100644
@@ -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;
utils/cec-compliance/cec-test.cpp +0 -4
index 5fac04a..07ba4b6 100644
@@ -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)
Signature · 1 line
2.7.4