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

Jacopo Mondi jacopo at jmondi.org
Tue Apr 28 22:10:09 CEST 2020


Hi Laurent,

On Tue, Apr 28, 2020 at 09:16:49PM +0300, Laurent Pinchart wrote:
> 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>

Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

Thanks
  j

> ---
>  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
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list