[libcamera-devel] [RFC PATCH v2 4/9] libcamera: test: Add ControlInfo tests

Niklas Söderlund niklas.soderlund at ragnatech.se
Sun Jun 23 17:23:15 CEST 2019


Hi Kieran,

Thanks for your work.

On 2019-06-21 17:13:56 +0100, Kieran Bingham wrote:
> Provide an initial test coverage for the ControlInfo class.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  test/controls.cpp | 40 ++++++++++++++++++++++++++++++++++++++++
>  test/meson.build  |  1 +
>  2 files changed, 41 insertions(+)
>  create mode 100644 test/controls.cpp
> 
> diff --git a/test/controls.cpp b/test/controls.cpp
> new file mode 100644
> index 000000000000..94e89f270108
> --- /dev/null
> +++ b/test/controls.cpp
> @@ -0,0 +1,40 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copyright (C) 2019, Google Inc.
> + *
> + * controls.cpp - Control tests
> + */
> +
> +#include <iostream>
> +
> +#include <libcamera/controls.h>
> +
> +#include "test.h"
> +
> +using namespace std;
> +using namespace libcamera;
> +
> +class Controls : public Test
> +{
> +protected:
> +	int testControlInfo()
> +	{
> +		ControlInfo gainInfo(ManualGain);
> +		cout << "Gain Info: " << gainInfo << endl;
> +
> +		return TestPass;
> +	}
> +
> +	int run()
> +	{
> +		int ret;
> +
> +		ret = testControlInfo();
> +		if (ret)
> +			return ret;
> +
> +		return TestPass;
> +	}
> +};
> +
> +TEST_REGISTER(Controls)
> diff --git a/test/meson.build b/test/meson.build
> index eff541ddc0a6..0b3e6c6813e6 100644
> --- a/test/meson.build
> +++ b/test/meson.build
> @@ -9,6 +9,7 @@ subdir('v4l2_subdevice')
>  subdir('v4l2_videodevice')
>  
>  public_tests = [
> +    ['controls',                        'controls.cpp'],
>      ['event',                           'event.cpp'],
>      ['event-dispatcher',                'event-dispatcher.cpp'],
>      ['geometry',                        'geometry.cpp'],
> -- 
> 2.20.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list