aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2018-11-27 16:31:42 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2018-11-27 16:31:42 +0100
commitecc1ef859e7b98a7268c275d292f2109fe1fe457 (patch)
tree16ec198d8d98ebddb3a5dc02b6eae863d08989dd
parentff0598b67bb673a46f8b515d51b6492cbc2c4dce (diff)
v4l2-compliance: test 'start streaming' error injection
If the driver under test is vivid, then make use of the 'start streaming' error injection feature to test what happens when it fails. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-test-buffers.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index 7ab555b5..36bfc47f 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -1151,6 +1151,13 @@ int testMmap(struct node *node, unsigned frame_count)
fail_on_test(setupMmap(node, q));
+ if (is_vivid) {
+ v4l2_control ctrl = {
+ .id = VIVID_CID_START_STR_ERROR,
+ };
+ if (!node->s_ctrl(ctrl))
+ fail_on_test(!node->streamon(q.g_type()));
+ }
fail_on_test(node->streamon(q.g_type()));
fail_on_test(node->streamon(q.g_type()));
@@ -1566,7 +1573,6 @@ int testRequests(struct node *node, bool test_streaming)
q.init(type, V4L2_MEMORY_MMAP);
fail_on_test(q.reqbufs(node, 2));
- fail_on_test(node->streamon(q.g_type()));
if (node->is_m2m) {
fail_on_test(m2m_q.reqbufs(node, 2));
fail_on_test(node->streamon(m2m_q.g_type()));
@@ -1651,6 +1657,16 @@ int testRequests(struct node *node, bool test_streaming)
fail_on_test(!(buf.g_flags() & V4L2_BUF_FLAG_QUEUED));
fail_on_test(doioctl_fd(buf_req_fds[i], MEDIA_REQUEST_IOC_REINIT, 0) != EBUSY);
fail_on_test(doioctl_fd(buf_req_fds[i], MEDIA_REQUEST_IOC_QUEUE, 0) != EBUSY);
+ if (i == num_bufs / 2) {
+ if (is_vivid) {
+ v4l2_control ctrl = {
+ .id = VIVID_CID_START_STR_ERROR,
+ };
+ if (!node->s_ctrl(ctrl))
+ fail_on_test(!node->streamon(q.g_type()));
+ }
+ fail_on_test(node->streamon(q.g_type()));
+ }
}
fail_on_test(node->g_fmt(cur_fmt, q.g_type()));

Privacy Policy