summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-04-28 21:13:20 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-04-28 23:13:26 +0300
commit5c8570cf3719260d58a7a8cf44a655dbf9dcb131 (patch)
treefbd999e4b3c93b89b038a6c570fff2a00b128099
parent68863657530812a21073fa463987fd414e1236bb (diff)
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--test/camera-sensor.cpp6
1 files changed, 6 insertions, 0 deletions
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<unsigned int> &codes = sensor_->mbusCodes();
auto iter = std::find(codes.begin(), codes.end(),
MEDIA_BUS_FMT_ARGB8888_1X32);