summaryrefslogtreecommitdiff
path: root/src/apps/lc-compliance/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/apps/lc-compliance/tests')
-rw-r--r--src/apps/lc-compliance/tests/capture_test.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/apps/lc-compliance/tests/capture_test.cpp b/src/apps/lc-compliance/tests/capture_test.cpp
index d02caa8a..29d8b7f8 100644
--- a/src/apps/lc-compliance/tests/capture_test.cpp
+++ b/src/apps/lc-compliance/tests/capture_test.cpp
@@ -15,13 +15,13 @@
#include <gtest/gtest.h>
-#include "environment.h"
+#include "test_base.h"
namespace {
using namespace libcamera;
-class SimpleCapture : public testing::TestWithParam<std::tuple<std::vector<StreamRole>, int>>
+class SimpleCapture : public testing::TestWithParam<std::tuple<std::vector<StreamRole>, int>>, public CameraHolder
{
public:
static std::string nameParameters(const testing::TestParamInfo<SimpleCapture::ParamType> &info);
@@ -29,8 +29,6 @@ public:
protected:
void SetUp() override;
void TearDown() override;
-
- std::shared_ptr<Camera> camera_;
};
/*
@@ -39,20 +37,12 @@ protected:
*/
void SimpleCapture::SetUp()
{
- Environment *env = Environment::get();
-
- camera_ = env->cm()->get(env->cameraId());
-
- ASSERT_EQ(camera_->acquire(), 0);
+ acquireCamera();
}
void SimpleCapture::TearDown()
{
- if (!camera_)
- return;
-
- camera_->release();
- camera_.reset();
+ releaseCamera();
}
std::string SimpleCapture::nameParameters(const testing::TestParamInfo<SimpleCapture::ParamType> &info)