aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance/cec-test-adapter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/cec-compliance/cec-test-adapter.cpp')
-rw-r--r--utils/cec-compliance/cec-test-adapter.cpp50
1 files changed, 30 insertions, 20 deletions
diff --git a/utils/cec-compliance/cec-test-adapter.cpp b/utils/cec-compliance/cec-test-adapter.cpp
index 6a8ce909..2cf0447c 100644
--- a/utils/cec-compliance/cec-test-adapter.cpp
+++ b/utils/cec-compliance/cec-test-adapter.cpp
@@ -1026,6 +1026,7 @@ int testLostMsgs(struct node *node)
fail_on_test(tx_queue_depth == 0 || tx_queue_depth > 19);
unsigned pending_msgs = 0;
+ unsigned pending_quick_msgs = 0;
unsigned pending_tx_ok_msgs = 0;
unsigned pending_tx_timed_out_msgs = 0;
unsigned pending_tx_arb_lost_msgs = 0;
@@ -1033,26 +1034,31 @@ int testLostMsgs(struct node *node)
unsigned pending_tx_low_drive_msgs = 0;
unsigned pending_tx_error_msgs = 0;
unsigned pending_rx_msgs = 0;
-
- fcntl(node->fd, F_SETFL, fcntl(node->fd, F_GETFL) & ~O_NONBLOCK);
- msg.timeout = 3000;
-
- while (!doioctl(node, CEC_RECEIVE, &msg)) {
- pending_msgs++;
- if (!msg.sequence)
- pending_rx_msgs++;
- else if (msg.tx_status & CEC_TX_STATUS_TIMEOUT)
- pending_tx_timed_out_msgs++;
- else if (msg.tx_status & CEC_TX_STATUS_OK)
- pending_tx_ok_msgs++;
- else if (msg.tx_status & CEC_TX_STATUS_NACK)
- pending_tx_nack_msgs++;
- else if (msg.tx_status & CEC_TX_STATUS_ARB_LOST)
- pending_tx_arb_lost_msgs++;
- else if (msg.tx_status & CEC_TX_STATUS_LOW_DRIVE)
- pending_tx_low_drive_msgs++;
- else
- pending_tx_error_msgs++;
+ time_t start = time(NULL);
+
+ for (unsigned i = 0; i < 2; i++) {
+ msg.timeout = 3000;
+
+ while (!doioctl(node, CEC_RECEIVE, &msg)) {
+ pending_msgs++;
+ if (i == 0)
+ pending_quick_msgs++;
+ if (!msg.sequence)
+ pending_rx_msgs++;
+ else if (msg.tx_status & CEC_TX_STATUS_TIMEOUT)
+ pending_tx_timed_out_msgs++;
+ else if (msg.tx_status & CEC_TX_STATUS_OK)
+ pending_tx_ok_msgs++;
+ else if (msg.tx_status & CEC_TX_STATUS_NACK)
+ pending_tx_nack_msgs++;
+ else if (msg.tx_status & CEC_TX_STATUS_ARB_LOST)
+ pending_tx_arb_lost_msgs++;
+ else if (msg.tx_status & CEC_TX_STATUS_LOW_DRIVE)
+ pending_tx_low_drive_msgs++;
+ else
+ pending_tx_error_msgs++;
+ }
+ fcntl(node->fd, F_SETFL, fcntl(node->fd, F_GETFL) & ~O_NONBLOCK);
}
/*
@@ -1076,6 +1082,10 @@ int testLostMsgs(struct node *node)
printf("\t\tError transmits: %d\n", pending_tx_error_msgs);
if (pending_rx_msgs)
printf("\t\tReceived messages: %d\n", pending_rx_msgs);
+ if (pending_quick_msgs < pending_msgs)
+ printf("\t\tReceived %d messages immediately, and %d over %ld seconds\n",
+ pending_quick_msgs, pending_msgs - pending_quick_msgs,
+ time(NULL) - start);
return fail("There were %d messages in the receive queue for %d transmits\n",
pending_msgs, xfer_cnt);
}

Privacy Policy