Message ID | 20210824195636.1110845-17-nfraprado@collabora.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
On Tue, Aug 24, 2021 at 04:56:35PM -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. > > For the SimpleCaptureUnbalanced test we need to do this check only if > the capture isn't over yet, otherwise the few extra requests that get > cancelled at the end, which is the normal behavior, will make the test > fail. > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > > --- > > Changes in v8: > - Fixed issue in UnbalancedStop test where requests cancelled due to stop() call > were failing the test > - Fixed formatting > > Changes in v5: > - New > > src/lc-compliance/simple_capture.cpp | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/src/lc-compliance/simple_capture.cpp b/src/lc-compliance/simple_capture.cpp > index d4805ff3403c..701d0feb70d1 100644 > --- a/src/lc-compliance/simple_capture.cpp > +++ b/src/lc-compliance/simple_capture.cpp > @@ -165,6 +165,9 @@ 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; > > @@ -202,6 +205,9 @@ void SimpleCaptureUnbalanced::requestComplete(Request *request) > if (captureCompleted()) > return; > > + EXPECT_EQ(request->status(), Request::Status::RequestComplete) > + << "Request didn't complete successfully"; > + > request->reuse(Request::ReuseBuffers); > if (camera_->queueRequest(request)) > loop_->exit(-EINVAL); > @@ -233,5 +239,8 @@ void SimpleCaptureOverflow::capture() > > void SimpleCaptureOverflow::requestComplete([[maybe_unused]] Request *request) > { > + EXPECT_EQ(request->status(), Request::Status::RequestComplete) > + << "Request didn't complete successfully"; > + > captureCompleted(); > } > -- > 2.33.0 >
diff --git a/src/lc-compliance/simple_capture.cpp b/src/lc-compliance/simple_capture.cpp index d4805ff3403c..701d0feb70d1 100644 --- a/src/lc-compliance/simple_capture.cpp +++ b/src/lc-compliance/simple_capture.cpp @@ -165,6 +165,9 @@ 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; @@ -202,6 +205,9 @@ void SimpleCaptureUnbalanced::requestComplete(Request *request) if (captureCompleted()) return; + EXPECT_EQ(request->status(), Request::Status::RequestComplete) + << "Request didn't complete successfully"; + request->reuse(Request::ReuseBuffers); if (camera_->queueRequest(request)) loop_->exit(-EINVAL); @@ -233,5 +239,8 @@ 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. For the SimpleCaptureUnbalanced test we need to do this check only if the capture isn't over yet, otherwise the few extra requests that get cancelled at the end, which is the normal behavior, will make the test fail. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> --- Changes in v8: - Fixed issue in UnbalancedStop test where requests cancelled due to stop() call were failing the test - Fixed formatting Changes in v5: - New src/lc-compliance/simple_capture.cpp | 9 +++++++++ 1 file changed, 9 insertions(+)