Message ID | 20220407083719.21631-3-laurent.pinchart@ideasonboard.com |
---|---|
State | Accepted |
Commit | 3980448e9f46f9ca2f27b38187215543984e3f5d |
Headers | show |
Series |
|
Related | show |
Hi Laurent, On Thu, Apr 07, 2022 at 11:37:18AM +0300, Laurent Pinchart via libcamera-devel wrote: > If the streamOn() call fails, there is no way the test will then > succeed. Catch it and return a failure. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > test/v4l2_videodevice/dequeue_watchdog.cpp | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/test/v4l2_videodevice/dequeue_watchdog.cpp b/test/v4l2_videodevice/dequeue_watchdog.cpp > index 2282e3958c03..320d14c8e442 100644 > --- a/test/v4l2_videodevice/dequeue_watchdog.cpp > +++ b/test/v4l2_videodevice/dequeue_watchdog.cpp > @@ -50,7 +50,11 @@ protected: > } > } > > - capture_->streamOn(); > + ret = capture_->streamOn(); > + if (ret < 0) { > + std::cout << "Failed to start streaming" << std::endl; > + return TestFail; > + } > > timeout.start(5s); > while (timeout.isRunning()) {
diff --git a/test/v4l2_videodevice/dequeue_watchdog.cpp b/test/v4l2_videodevice/dequeue_watchdog.cpp index 2282e3958c03..320d14c8e442 100644 --- a/test/v4l2_videodevice/dequeue_watchdog.cpp +++ b/test/v4l2_videodevice/dequeue_watchdog.cpp @@ -50,7 +50,11 @@ protected: } } - capture_->streamOn(); + ret = capture_->streamOn(); + if (ret < 0) { + std::cout << "Failed to start streaming" << std::endl; + return TestFail; + } timeout.start(5s); while (timeout.isRunning()) {
If the streamOn() call fails, there is no way the test will then succeed. Catch it and return a failure. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- test/v4l2_videodevice/dequeue_watchdog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)