@@ -2,6 +2,7 @@
# They are not alphabetically sorted.
v4l2_device_tests = [
[ 'double_open', 'double_open.cpp' ],
+ [ 'request_buffers', 'request_buffers.cpp' ],
]
foreach t : v4l2_device_tests
new file mode 100644
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2019, Google Inc.
+ *
+ * libcamera V4L2 API tests
+ */
+
+#include "v4l2_device_test.h"
+
+class RequestBuffers : public V4L2DeviceTest
+{
+protected:
+ int run()
+ {
+ /* TODO:
+ * Test invalid requests
+ * Test different buffer allocations
+ */
+ BufferPool *pool = dev_->requestBuffers(8);
+
+ if (!pool)
+ return TestFail;
+
+ return TestPass;
+ }
+};
+
+TEST_REGISTER(RequestBuffers);
Add a utility to the test suite to request and allocate buffers from a V4L2Device to ensure it functions successfully. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- test/v4l2_device/meson.build | 1 + test/v4l2_device/request_buffers.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 test/v4l2_device/request_buffers.cpp