[libcamera-devel] [PATCH v2 2/3] test: camera_sensor: Test the model() function

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Apr 28 20:16:49 CEST 2020


Verify that the sensor model matches the expected value. The whole model
extraction heuristic isn't fully tested as that would require being able
to inject different entity names. It is still useful as an initial step.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 test/camera-sensor.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp
index 27c190fe7ace..6069d668e495 100644
--- a/test/camera-sensor.cpp
+++ b/test/camera-sensor.cpp
@@ -61,6 +61,12 @@ protected:
 
 	int run()
 	{
+		if (sensor_->model() != "Sensor A") {
+			cerr << "Incorrect sensor model '" << sensor_->model()
+			     << "'" << endl;
+			return TestFail;
+		}
+
 		const std::vector<unsigned int> &codes = sensor_->mbusCodes();
 		auto iter = std::find(codes.begin(), codes.end(),
 				      MEDIA_BUS_FMT_ARGB8888_1X32);
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list