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

Message ID 20210707144202.1327061-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 7, 2021, 2:42 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>
---

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 5aecc1ab0afc..7bdc8abc4c0b 100644
--- a/src/lc-compliance/simple_capture.cpp
+++ b/src/lc-compliance/simple_capture.cpp
@@ -175,6 +175,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;
 
@@ -210,6 +211,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;
 
@@ -245,5 +247,6 @@  void SimpleCaptureOverflow::capture()
 
 void SimpleCaptureOverflow::requestComplete([[maybe_unused]] Request *request)
 {
+	EXPECT_EQ(request->status(), Request::Status::RequestComplete) << "Request didn't complete successfully";
 	captureCompleted();
 }