From patchwork Sat Dec 23 11:10:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 19346 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8EAC8BDB1D for ; Sat, 23 Dec 2023 11:10:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 77FD762B5C; Sat, 23 Dec 2023 12:10:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1703329839; bh=qneqtV9quvOjU67kpSxwhaJzfrt4bucT1eOPM/MgTvQ=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=FDoRcWzmFnI4ZDZf+fMKW0akgXhLiuQjb7a32tuARLkzPy7yTWE5t9jkkpR1UHGRJ af68dcN13cvYwxBIHWbCmuat5g0SqZPh3vwDW8gdSiJsEHsJI6GciPfm+3edARBCJ+ hSB8uKFibW7SilTfCg9qah/H8W5aER5hT88WrYDs67Zi99FIJ80XVts9B4weMzsPH3 023lnw7q+AP+miIqUSao3zW/vvKcO6l9FnxLlGIgg0am3++l8gq80+y+sAwklK3B6h uFiEtwseyoD7j/oj7sufOQtFNzYMyXfg3hLVDy3c/1iu3j5H+RYdO0EJNW2zIGNiuU ubmOSKId5etNg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0597A62B31 for ; Sat, 23 Dec 2023 12:10:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UYT5rkMP"; dkim-atps=neutral Received: from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 942349A8; Sat, 23 Dec 2023 12:09:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1703329783; bh=qneqtV9quvOjU67kpSxwhaJzfrt4bucT1eOPM/MgTvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UYT5rkMPMTLQrhePi/PToHOrh1BLoz562Gn/opiP+qiR31CvxfFuxlmmuWRDaZXbl v9pvz+BvjQbSpdl+sC9p+9up2gePOvJxaCWL541ITXK1tvY3XJIWe1I3BC7yYZBoGU zq9ei0NVcEqZdawV4Y3KPBR/mDf6RwJhhrK6x6C4= To: libcamera-devel@lists.libcamera.org Date: Sat, 23 Dec 2023 12:10:20 +0100 Message-ID: <20231223111023.668199-3-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231223111023.668199-1-jacopo.mondi@ideasonboard.com> References: <20231223111023.668199-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/5] apps: lc-compliance: Check that requests complete successfully X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: NĂ­colas F. R. A. Prado 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 Reviewed-by: Paul Elder Signed-off-by: Paul Elder --- src/apps/lc-compliance/simple_capture.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/apps/lc-compliance/simple_capture.cpp b/src/apps/lc-compliance/simple_capture.cpp index cf4d7cf38bc3..e22a339c4e1c 100644 --- a/src/apps/lc-compliance/simple_capture.cpp +++ b/src/apps/lc-compliance/simple_capture.cpp @@ -127,6 +127,9 @@ int SimpleCaptureBalanced::queueRequest(Request *request) void SimpleCaptureBalanced::requestComplete(Request *request) { + EXPECT_EQ(request->status(), Request::Status::RequestComplete) + << "Request didn't complete successfully"; + captureCount_++; if (captureCount_ >= captureLimit_) { loop_->exit(0); @@ -184,6 +187,9 @@ void SimpleCaptureUnbalanced::requestComplete(Request *request) return; } + EXPECT_EQ(request->status(), Request::Status::RequestComplete) + << "Request didn't complete successfully"; + request->reuse(Request::ReuseBuffers); if (camera_->queueRequest(request)) loop_->exit(-EINVAL);