From fac471e812a988905aa2c6a0914f5fc9a72ee111 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 27 Oct 2019 19:20:39 +0200 Subject: test: Extract CameraTest class out of camera tests to libtest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many tests other than the camera/ tests use a camera. To increase code sharing, move the base CameraTest class to the test library. The class becomes a helper that doesn't inherit from Test anymore (to avoid diamond inheritance issues when more such helpers will exist). Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- test/camera/capture.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'test/camera/capture.cpp') diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp index 83f97474..7cb76038 100644 --- a/test/camera/capture.cpp +++ b/test/camera/capture.cpp @@ -8,13 +8,20 @@ #include #include "camera_test.h" +#include "test.h" using namespace std; namespace { -class Capture : public CameraTest +class Capture : public CameraTest, public Test { +public: + Capture() + : CameraTest("VIMC Sensor B") + { + } + protected: unsigned int completeBuffersCount_; unsigned int completeRequestsCount_; @@ -48,14 +55,12 @@ protected: int init() override { - int ret = CameraTest::init(); - if (ret) - return ret; + if (status_ != TestPass) + return status_; config_ = camera_->generateConfiguration({ StreamRole::VideoRecording }); if (!config_ || config_->size() != 1) { cout << "Failed to generate default configuration" << endl; - CameraTest::cleanup(); return TestFail; } -- cgit v1.2.1