aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2018-12-10 11:04:00 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2018-12-10 11:04:00 +0100
commitd039b47a108596ca004b11e52989054882d45888 (patch)
tree6ad759a9ae249fbb03832d203ad7eb1c4db49366
parentf057e64058e760b1937c019783d024850a1acf16 (diff)
v4l2-compliance: test 'invalid request' error injection
Use the new vivid capability to inject an error into the request validation. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-compliance/v4l2-test-buffers.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index ad7d2a8d..9b94eab8 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -45,6 +45,7 @@
#define VIVID_CID_BUF_PREPARE_ERROR (VIVID_CID_VIVID_BASE + 68)
#define VIVID_CID_START_STR_ERROR (VIVID_CID_VIVID_BASE + 69)
#define VIVID_CID_QUEUE_ERROR (VIVID_CID_VIVID_BASE + 70)
+#define VIVID_CID_REQ_VALIDATE_ERROR (VIVID_CID_VIVID_BASE + 72)
static struct cv4l_fmt cur_fmt;
static int stream_from_fd = -1;
@@ -1760,7 +1761,9 @@ int testRequests(struct node *node, bool test_streaming)
fail_on_test(buf.querybuf(node, i));
fail_on_test(!(buf.g_flags() & V4L2_BUF_FLAG_IN_REQUEST));
fail_on_test(!(buf.g_flags() & V4L2_BUF_FLAG_REQUEST_FD));
- if ((i & 1) && node->inject_error(VIVID_CID_BUF_PREPARE_ERROR))
+ if ((i & 1) && node->inject_error(i > num_bufs / 2 ?
+ VIVID_CID_BUF_PREPARE_ERROR :
+ VIVID_CID_REQ_VALIDATE_ERROR))
fail_on_test(doioctl_fd(buf_req_fds[i],
MEDIA_REQUEST_IOC_QUEUE, 0) != EINVAL);
fail_on_test(doioctl_fd(buf_req_fds[i], MEDIA_REQUEST_IOC_QUEUE, 0));

Privacy Policy