[libcamera-devel,v6,08/10] lc-compliance: Check that requests complete successfully
diff mbox series

Message ID 20210714183857.2046425-9-nfraprado@collabora.com
State Superseded
Headers show
Series
  • lc-compliance: Add test to queue more requests than hardware depth
Related show

Commit Message

NĂ­colas F. R. A. Prado July 14, 2021, 6:38 p.m. UTC
When a request fails to queue it is completed but with its status set to
RequestCancelled. Add a check in the requestComplete callback to make
sure that the request was completed successfully.

Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
---

No changes in v6

Added in v5

 src/lc-compliance/simple_capture.cpp | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/src/lc-compliance/simple_capture.cpp b/src/lc-compliance/simple_capture.cpp
index d1e691abfec1..1883bbb524ac 100644
--- a/src/lc-compliance/simple_capture.cpp
+++ b/src/lc-compliance/simple_capture.cpp
@@ -178,6 +178,7 @@  int SimpleCaptureBalanced::queueRequest(Request *request)
 
 void SimpleCaptureBalanced::requestComplete(Request *request)
 {
+	EXPECT_EQ(request->status(), Request::Status::RequestComplete) << "Request didn't complete successfully";
 	if (captureCompleted())
 		return;
 
@@ -213,6 +214,7 @@  void SimpleCaptureUnbalanced::capture(unsigned int numRequests)
 
 void SimpleCaptureUnbalanced::requestComplete(Request *request)
 {
+	EXPECT_EQ(request->status(), Request::Status::RequestComplete) << "Request didn't complete successfully";
 	if (captureCompleted())
 		return;
 
@@ -248,5 +250,6 @@  void SimpleCaptureOverflow::capture()
 
 void SimpleCaptureOverflow::requestComplete([[maybe_unused]] Request *request)
 {
+	EXPECT_EQ(request->status(), Request::Status::RequestComplete) << "Request didn't complete successfully";
 	captureCompleted();
 }