From 5c8570cf3719260d58a7a8cf44a655dbf9dcb131 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 28 Apr 2020 21:13:20 +0300 Subject: test: camera_sensor: Test the model() function 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 Reviewed-by: Jacopo Mondi --- test/camera-sensor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/camera-sensor.cpp') diff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp index 27c190fe..6069d668 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 &codes = sensor_->mbusCodes(); auto iter = std::find(codes.begin(), codes.end(), MEDIA_BUS_FMT_ARGB8888_1X32); -- cgit v1.2.1