diff options
Diffstat (limited to 'test/v4l2_videodevice')
-rw-r--r-- | test/v4l2_videodevice/controls.cpp | 2 | ||||
-rw-r--r-- | test/v4l2_videodevice/meson.build | 26 | ||||
-rw-r--r-- | test/v4l2_videodevice/v4l2_m2mdevice.cpp | 5 | ||||
-rw-r--r-- | test/v4l2_videodevice/v4l2_videodevice_test.cpp | 2 | ||||
-rw-r--r-- | test/v4l2_videodevice/v4l2_videodevice_test.h | 2 |
5 files changed, 21 insertions, 16 deletions
diff --git a/test/v4l2_videodevice/controls.cpp b/test/v4l2_videodevice/controls.cpp index 0f603b85..b0130295 100644 --- a/test/v4l2_videodevice/controls.cpp +++ b/test/v4l2_videodevice/controls.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2019, Google Inc. * - * controls.cpp - V4L2 device controls handling test + * V4L2 device controls handling test */ #include <algorithm> diff --git a/test/v4l2_videodevice/meson.build b/test/v4l2_videodevice/meson.build index 7a26f53d..87ea4f96 100644 --- a/test/v4l2_videodevice/meson.build +++ b/test/v4l2_videodevice/meson.build @@ -3,22 +3,22 @@ # Tests are listed in order of complexity. # They are not alphabetically sorted. v4l2_videodevice_tests = [ - ['double_open', 'double_open.cpp'], - ['controls', 'controls.cpp'], - ['formats', 'formats.cpp'], - ['dequeue_watchdog', 'dequeue_watchdog.cpp'], - ['request_buffers', 'request_buffers.cpp'], - ['buffer_cache', 'buffer_cache.cpp'], - ['stream_on_off', 'stream_on_off.cpp'], - ['capture_async', 'capture_async.cpp'], - ['buffer_sharing', 'buffer_sharing.cpp'], - ['v4l2_m2mdevice', 'v4l2_m2mdevice.cpp'], + {'name': 'double_open', 'sources': ['double_open.cpp']}, + {'name': 'controls', 'sources': ['controls.cpp']}, + {'name': 'formats', 'sources': ['formats.cpp']}, + {'name': 'dequeue_watchdog', 'sources': ['dequeue_watchdog.cpp']}, + {'name': 'request_buffers', 'sources': ['request_buffers.cpp']}, + {'name': 'buffer_cache', 'sources': ['buffer_cache.cpp']}, + {'name': 'stream_on_off', 'sources': ['stream_on_off.cpp']}, + {'name': 'capture_async', 'sources': ['capture_async.cpp']}, + {'name': 'buffer_sharing', 'sources': ['buffer_sharing.cpp']}, + {'name': 'v4l2_m2mdevice', 'sources': ['v4l2_m2mdevice.cpp']}, ] -foreach t : v4l2_videodevice_tests - exe = executable(t[0], [t[1], 'v4l2_videodevice_test.cpp'], +foreach test : v4l2_videodevice_tests + exe = executable(test['name'], [test['sources'], 'v4l2_videodevice_test.cpp'], dependencies : libcamera_private, link_with : test_libraries, include_directories : test_includes_internal) - test(t[0], exe, suite : 'v4l2_videodevice', is_parallel : false) + test(test['name'], exe, suite : 'v4l2_videodevice', is_parallel : false) endforeach diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp index 852b853f..c45f581a 100644 --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp @@ -95,6 +95,11 @@ protected: V4L2VideoDevice *capture = vim2m_->capture(); V4L2VideoDevice *output = vim2m_->output(); + if (capture->controls().empty() || output->controls().empty()) { + cerr << "VIM2M device has no control" << endl; + return TestFail; + } + V4L2DeviceFormat format = {}; if (capture->getFormat(&format)) { cerr << "Failed to get capture format" << endl; diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.cpp b/test/v4l2_videodevice/v4l2_videodevice_test.cpp index 125aafd6..1113cf5b 100644 --- a/test/v4l2_videodevice/v4l2_videodevice_test.cpp +++ b/test/v4l2_videodevice/v4l2_videodevice_test.cpp @@ -75,7 +75,7 @@ int V4L2VideoDeviceTest::init() format.fourcc = V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8); V4L2SubdeviceFormat subformat = {}; - subformat.mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8; + subformat.code = MEDIA_BUS_FMT_SBGGR8_1X8; subformat.size = format.size; if (sensor_->setFormat(&subformat)) diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.h b/test/v4l2_videodevice/v4l2_videodevice_test.h index d2de1a6d..b5871ce6 100644 --- a/test/v4l2_videodevice/v4l2_videodevice_test.h +++ b/test/v4l2_videodevice/v4l2_videodevice_test.h @@ -2,7 +2,7 @@ /* * Copyright (C) 2018, Google Inc. * - * vl42device_test.h - libcamera v4l2device test base class + * libcamera v4l2device test base class */ #pragma once |