summaryrefslogtreecommitdiff
path: root/test/media_device/media_device_test.h
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-04-29 20:00:39 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-05-17 20:35:00 +0200
commit9654d1f64a216214304706802fab19a71eaf5cf1 (patch)
tree93b944fb26a520aa6e516954cba324b760da2e5c /test/media_device/media_device_test.h
parent1a813a5c3ab71a91e327d538d0df5d945e50561e (diff)
test: media_device: Create a common MediaDeviceTest base class
Before adding more tests which will act on the vimc pipeline break out a common base from media_device_link_test.cpp which already acts on vimc. The new common base class will help reduce code duplication. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test/media_device/media_device_test.h')
-rw-r--r--test/media_device/media_device_test.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/media_device/media_device_test.h b/test/media_device/media_device_test.h
new file mode 100644
index 00000000..cdbd1484
--- /dev/null
+++ b/test/media_device/media_device_test.h
@@ -0,0 +1,34 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2019, Google Inc.
+ *
+ * media_device_test.h - libcamera media device test base class
+ */
+#ifndef __LIBCAMERA_MEDIADEVICE_TEST_H__
+#define __LIBCAMERA_MEDIADEVICE_TEST_H__
+
+#include <memory>
+
+#include "device_enumerator.h"
+#include "media_device.h"
+
+#include "test.h"
+
+using namespace libcamera;
+
+class MediaDeviceTest : public Test
+{
+public:
+ MediaDeviceTest()
+ : media_(nullptr), enumerator_(nullptr) {}
+
+protected:
+ int init();
+
+ std::shared_ptr<MediaDevice> media_;
+
+private:
+ std::unique_ptr<DeviceEnumerator> enumerator_;
+};
+
+#endif /* __LIBCAMERA_MEDIADEVICE_TEST_H__ */