Message ID | 20190621161401.28337-5-kieran.bingham@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
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@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@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@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
Hi Kieran, Thank you for the patch. On Fri, Jun 21, 2019 at 05:13:56PM +0100, Kieran Bingham wrote: > Provide an initial test coverage for the ControlInfo class. > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > 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; A test that always succeeds is not a test... > + } > +}; > + > +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'],
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'],
Provide an initial test coverage for the ControlInfo class. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- test/controls.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ test/meson.build | 1 + 2 files changed, 41 insertions(+) create mode 100644 test/controls.cpp