Message ID | 20190523135900.24029-3-kieran.bingham@ideasonboard.com |
---|---|
State | Deferred |
Delegated to: | Kieran Bingham |
Headers | show |
Series |
|
Related | show |
Hi Kieran, On Thu, May 23, 2019 at 02:58:59PM +0100, Kieran Bingham wrote: > Add a new test to verify the tryFormat() functionality updates the > attempted format. > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > test/v4l2_device/formats.cpp | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/test/v4l2_device/formats.cpp b/test/v4l2_device/formats.cpp > index 6be045ff754c..1ed9901a9e4e 100644 > --- a/test/v4l2_device/formats.cpp > +++ b/test/v4l2_device/formats.cpp > @@ -31,6 +31,22 @@ protected: > return TestFail; > } > > + format.size = { UINT_MAX, UINT_MAX }; > + ret = capture_->tryFormat(&format); > + if (ret) { > + cerr << "Failed to try format: image resolution is invalid: " > + << "(UINT_MAX x UINT_MAX) but setFormat() should not fail." nit: "but tryFormat() should not fail" > + << endl; > + return TestFail; > + } > + > + if (format.size.width == UINT_MAX || > + format.size.height == UINT_MAX) { > + cerr << "Failed to update image (try) format = (UINT_MAX x UINT_MAX)" > + << endl; > + return TestFail; > + } > + Looks good! Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Thanks j > format.size = { UINT_MAX, UINT_MAX }; > ret = capture_->setFormat(&format); > if (ret) { > -- > 2.20.1 > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
diff --git a/test/v4l2_device/formats.cpp b/test/v4l2_device/formats.cpp index 6be045ff754c..1ed9901a9e4e 100644 --- a/test/v4l2_device/formats.cpp +++ b/test/v4l2_device/formats.cpp @@ -31,6 +31,22 @@ protected: return TestFail; } + format.size = { UINT_MAX, UINT_MAX }; + ret = capture_->tryFormat(&format); + if (ret) { + cerr << "Failed to try format: image resolution is invalid: " + << "(UINT_MAX x UINT_MAX) but setFormat() should not fail." + << endl; + return TestFail; + } + + if (format.size.width == UINT_MAX || + format.size.height == UINT_MAX) { + cerr << "Failed to update image (try) format = (UINT_MAX x UINT_MAX)" + << endl; + return TestFail; + } + format.size = { UINT_MAX, UINT_MAX }; ret = capture_->setFormat(&format); if (ret) {
Add a new test to verify the tryFormat() functionality updates the attempted format. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- test/v4l2_device/formats.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)