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>
This commit is contained in:
Laurent Pinchart 2020-04-28 21:13:20 +03:00
parent 6886365753
commit 5c8570cf37

View file

@ -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);