This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:
Subject: v4l2-compliance: fix read/write tests Author: Hans Verkuil <hverkuil-ci...@xs4all.nl> Date: Tue Oct 15 12:48:19 2019 +0200 The read test failed for metadata capture if that is not supported by the current input (read returns EINVAL in that case). Allow for such situations. The same situation occurs for VBI, but that worked since there was a specific check for VBI. Improve the test for VBI as well, verifying that read()/write() for a VBI device fails if no VBI is supported for the current input/output. Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl> utils/v4l2-compliance/v4l2-test-buffers.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) --- http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=b51e9a8a74eed6da15127fe5eadf515914347f76 diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp index 029d0ed0ea02..c96000928e8b 100644 --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp @@ -768,26 +768,29 @@ int testReadWrite(struct node *node) bool can_rw = node->g_caps() & V4L2_CAP_READWRITE; int fd_flags = fcntl(node->g_fd(), F_GETFL); char buf = 0; - int ret; - - if (v4l_has_vbi(node->g_v4l_fd()) && - !(node->cur_io_caps & V4L2_IN_CAP_STD)) { - return 0; - } + int ret, ret2; + int err, err2; fcntl(node->g_fd(), F_SETFL, fd_flags | O_NONBLOCK); + errno = 0; if (node->can_capture) ret = node->read(&buf, 1); else ret = node->write(&buf, 1); + err = errno; + fail_on_test(v4l_has_vbi(node->g_v4l_fd()) && + !(node->cur_io_caps & V4L2_IN_CAP_STD) && ret >= 0); + // Note: RDS can only return multiples of 3, so we accept // both 0 and 1 as return code. // EBUSY can be returned when attempting to read/write to a // multiplanar format. + // EINVAL can be returned if read()/write() is not supported + // for the current input/output. if (can_rw) - fail_on_test((ret < 0 && errno != EAGAIN && errno != EBUSY) || ret > 1); + fail_on_test((ret < 0 && err != EAGAIN && err != EBUSY && err != EINVAL) || ret > 1); else - fail_on_test(ret >= 0 || errno != EINVAL); + fail_on_test(ret >= 0 || err != EINVAL); if (!can_rw) return ENOTTY; @@ -795,11 +798,13 @@ int testReadWrite(struct node *node) fcntl(node->g_fd(), F_SETFL, fd_flags | O_NONBLOCK); /* check that the close cleared the busy flag */ + errno = 0; if (node->can_capture) - ret = node->read(&buf, 1); + ret2 = node->read(&buf, 1); else - ret = node->write(&buf, 1); - fail_on_test((ret < 0 && errno != EAGAIN && errno != EBUSY) || ret > 1); + ret2 = node->write(&buf, 1); + err2 = errno; + fail_on_test(ret2 != ret || err2 != err); return 0; } _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits