[libcamera-devel,08/14] test: camera: Use the CameraManager from the CameraTest base class

Message ID 20190818011329.14499-9-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • Assorted fixes for Android camera HAL
Related show

Commit Message

Laurent Pinchart Aug. 18, 2019, 1:13 a.m. UTC
Make the camera manager a protected field of the CameraTest class, and
use it instead of CameraManager::instance() in the camera tests. This
prepares for the removal of CameraManager::instance().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/camera/buffer_import.cpp | 2 +-
 test/camera/camera_test.h     | 4 +---
 test/camera/capture.cpp       | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

Patch

diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp
index 98786469428f..9364e3d1bc44 100644
--- a/test/camera/buffer_import.cpp
+++ b/test/camera/buffer_import.cpp
@@ -375,7 +375,7 @@  protected:
 			return TestFail;
 		}
 
-		EventDispatcher *dispatcher = CameraManager::instance()->eventDispatcher();
+		EventDispatcher *dispatcher = cm_->eventDispatcher();
 
 		Timer timer;
 		timer.start(5000);
diff --git a/test/camera/camera_test.h b/test/camera/camera_test.h
index ffc8a485bfaf..e57b05eb28a9 100644
--- a/test/camera/camera_test.h
+++ b/test/camera/camera_test.h
@@ -23,10 +23,8 @@  protected:
 	int init();
 	void cleanup();
 
-	std::shared_ptr<Camera> camera_;
-
-private:
 	CameraManager *cm_;
+	std::shared_ptr<Camera> camera_;
 };
 
 #endif /* __LIBCAMERA_CAMERA_TEST_H__ */
diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp
index e6bf7a8d9ebb..791ccad15f70 100644
--- a/test/camera/capture.cpp
+++ b/test/camera/capture.cpp
@@ -120,7 +120,7 @@  protected:
 			}
 		}
 
-		EventDispatcher *dispatcher = CameraManager::instance()->eventDispatcher();
+		EventDispatcher *dispatcher = cm_->eventDispatcher();
 
 		Timer timer;
 		timer.start(1000);