@@ -14,6 +14,7 @@ lc_compliance_sources = files([
'capture_test.cpp',
'environment.cpp',
'main.cpp',
+ 'property_test.cpp',
'simple_capture.cpp',
'test_base.cpp',
])
new file mode 100644
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2021, Collabora Ltd.
+ *
+ * property_test.cpp - Test camera properties
+ */
+
+#include <libcamera/libcamera.h>
+
+#include <gtest/gtest.h>
+
+#include "test_base.h"
+
+using namespace libcamera;
+
+TEST_F(CameraTests, RequiredProperties)
+{
+ const ControlList &properties = camera_->properties();
+
+ using namespace properties;
+
+ EXPECT_GT(properties.get(MinimumRequests), 0)
+ << "Camera should have a positive value for MinimumRequests property";
+}
@@ -26,3 +26,13 @@ void CameraHolder::releaseCamera()
camera_->release();
camera_.reset();
}
+
+void CameraTests::SetUp()
+{
+ acquireCamera();
+}
+
+void CameraTests::TearDown()
+{
+ releaseCamera();
+}
@@ -21,4 +21,11 @@ protected:
std::shared_ptr<libcamera::Camera> camera_;
};
+class CameraTests : public ::testing::Test, public CameraHolder
+{
+protected:
+ void SetUp() override;
+ void TearDown() override;
+};
+
#endif /* __LC_COMPLIANCE_TEST_BASE_H__ */