summaryrefslogtreecommitdiff
path: root/test/media_device/media_device_acquire.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/media_device/media_device_acquire.cpp')
-rw-r--r--test/media_device/media_device_acquire.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/media_device/media_device_acquire.cpp b/test/media_device/media_device_acquire.cpp
new file mode 100644
index 00000000..d1e3d744
--- /dev/null
+++ b/test/media_device/media_device_acquire.cpp
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2019, Google Inc.
+ *
+ * media_device_acquire.cpp- Test acquire/release of a MediaDevice
+ */
+
+#include "media_device_test.h"
+
+using namespace libcamera;
+
+class MediaDeviceAcquire : public MediaDeviceTest
+{
+ int run()
+ {
+ if (!media_->acquire())
+ return TestFail;
+
+ if (media_->acquire())
+ return TestFail;
+
+ media_->release();
+
+ if (!media_->acquire())
+ return TestFail;
+
+ media_->release();
+
+ return TestPass;
+ }
+};
+
+TEST_REGISTER(MediaDeviceAcquire);