mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
apps: lc-compliance: Check that requests complete successfully
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> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
This commit is contained in:
parent
8106b6671f
commit
3e93337996
1 changed files with 6 additions and 0 deletions
|
@ -127,6 +127,9 @@ int SimpleCaptureBalanced::queueRequest(Request *request)
|
||||||
|
|
||||||
void SimpleCaptureBalanced::requestComplete(Request *request)
|
void SimpleCaptureBalanced::requestComplete(Request *request)
|
||||||
{
|
{
|
||||||
|
EXPECT_EQ(request->status(), Request::Status::RequestComplete)
|
||||||
|
<< "Request didn't complete successfully";
|
||||||
|
|
||||||
captureCount_++;
|
captureCount_++;
|
||||||
if (captureCount_ >= captureLimit_) {
|
if (captureCount_ >= captureLimit_) {
|
||||||
loop_->exit(0);
|
loop_->exit(0);
|
||||||
|
@ -184,6 +187,9 @@ void SimpleCaptureUnbalanced::requestComplete(Request *request)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPECT_EQ(request->status(), Request::Status::RequestComplete)
|
||||||
|
<< "Request didn't complete successfully";
|
||||||
|
|
||||||
request->reuse(Request::ReuseBuffers);
|
request->reuse(Request::ReuseBuffers);
|
||||||
if (camera_->queueRequest(request))
|
if (camera_->queueRequest(request))
|
||||||
loop_->exit(-EINVAL);
|
loop_->exit(-EINVAL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue