[libcamera-devel,1/3] test: v4l2_videodevice: dequeue_watchdog: Log message on failures
diff mbox series

Message ID 20220407083719.21631-2-laurent.pinchart@ideasonboard.com
State Accepted
Commit dd76f8e11b0f7ad5fa5d51ff8e26727536db948f
Headers show
Series
  • test: Fix dequeue_watchdog test failure when running the whole test suite
Related show

Commit Message

Laurent Pinchart April 7, 2022, 8:37 a.m. UTC
Failing a test without an error message makes it difficult to debug
issues. Add a message when buffer allocation fails.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/v4l2_videodevice/dequeue_watchdog.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Nicolas Dufresne via libcamera-devel April 7, 2022, 11:15 a.m. UTC | #1
Hi Laurent,

On Thu, Apr 07, 2022 at 11:37:17AM +0300, Laurent Pinchart via libcamera-devel wrote:
> Failing a test without an error message makes it difficult to debug
> issues. Add a message when buffer allocation fails.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  test/v4l2_videodevice/dequeue_watchdog.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/test/v4l2_videodevice/dequeue_watchdog.cpp b/test/v4l2_videodevice/dequeue_watchdog.cpp
> index 0cb4de6f81a0..2282e3958c03 100644
> --- a/test/v4l2_videodevice/dequeue_watchdog.cpp
> +++ b/test/v4l2_videodevice/dequeue_watchdog.cpp
> @@ -33,8 +33,10 @@ protected:
>  		Timer timeout;
>  
>  		int ret = capture_->allocateBuffers(bufferCount, &buffers_);
> -		if (ret < 0)
> +		if (ret < 0) {
> +			std::cout << "Failed to allocate buffers" << std::endl;
>  			return TestFail;
> +		}
>  
>  		capture_->dequeueTimeout.connect(this, &DequeueWatchdogTest::barkCounter);
>  		capture_->setDequeueTimeout(5ms);

Patch
diff mbox series

diff --git a/test/v4l2_videodevice/dequeue_watchdog.cpp b/test/v4l2_videodevice/dequeue_watchdog.cpp
index 0cb4de6f81a0..2282e3958c03 100644
--- a/test/v4l2_videodevice/dequeue_watchdog.cpp
+++ b/test/v4l2_videodevice/dequeue_watchdog.cpp
@@ -33,8 +33,10 @@  protected:
 		Timer timeout;
 
 		int ret = capture_->allocateBuffers(bufferCount, &buffers_);
-		if (ret < 0)
+		if (ret < 0) {
+			std::cout << "Failed to allocate buffers" << std::endl;
 			return TestFail;
+		}
 
 		capture_->dequeueTimeout.connect(this, &DequeueWatchdogTest::barkCounter);
 		capture_->setDequeueTimeout(5ms);