Message ID | 20210722232851.747614-9-nfraprado@collabora.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Nícolas, Thank you for the patch. On Thu, Jul 22, 2021 at 08:28:48PM -0300, Nícolas F. R. A. Prado wrote: > 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. Do those three tests ensure that there will be no frame queued when they stop() the camera ? Otherwise there could be requests that get cancelled at that point. > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > --- > > No changes in v7 > > No changes in v6 > > Added in v5 > > src/lc-compliance/simple_capture.cpp | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/lc-compliance/simple_capture.cpp b/src/lc-compliance/simple_capture.cpp > index 48ce8f088e71..691e5fdb2aca 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"; Line wrap, and blank line after ? Same below. > 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(); > }
diff --git a/src/lc-compliance/simple_capture.cpp b/src/lc-compliance/simple_capture.cpp index 48ce8f088e71..691e5fdb2aca 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(); }
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 v7 No changes in v6 Added in v5 src/lc-compliance/simple_capture.cpp | 3 +++ 1 file changed, 3 insertions(+)