From patchwork Sat Dec 30 16:29:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 19353 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 B412DC3295 for ; Sat, 30 Dec 2023 16:29:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6A91862B61; Sat, 30 Dec 2023 17:29:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1703953776; 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=dd3WKFGqqIoqD7WFWFBK6+9XGNR4Jyjbi4I2ejuWTzmAbjR2782Zjr1yMCSWCNLOb QYu59nG/WCW2304/Q2H6G3lLYjPBQZ0Ixh5i8jXD83PrzQZ4ADRAF63RQP+piM51Tg bqqauOKJA+giTobhqI7RlWWZzDupkLi1/00SrkJmx71YaNvzz+LOxomX+X9GiLCRGG iH6b3K61+g5NHeB1NQUc8Vg9TtUHxy3TGZLj8dkAMgrUVUrAgKzn+fmTijLA3u7iq/ DP8qZQZhxWr6QpL4w3+9kRQs+fy3WNnrSUQz0XlSQUdJ1fhnb3+C6l32FFFwDyZQIF LsrKWeyddTfWg== 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 9C9AF62B40 for ; Sat, 30 Dec 2023 17:29:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VOXkWDbw"; 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 0E1CA9B6; Sat, 30 Dec 2023 17:28:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1703953715; bh=qneqtV9quvOjU67kpSxwhaJzfrt4bucT1eOPM/MgTvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VOXkWDbwUe/yXTBcdhYoQfeLDIvOtnK/3lBpWdRIEzhw79LLQx1FFzuTQhCdldP/p ADk279NiTQrlbFEDyDsKJJPCH0AODbH1LGdL+xKHHjfPn8/hFAonF5pjyyKnP4R9wb 2yqHsHsjDaAn5WFhHKd9qWgoPAj+ZAg993bTN5NE= To: libcamera-devel@lists.libcamera.org Date: Sat, 30 Dec 2023 17:29:07 +0100 Message-ID: <20231230162912.827669-3-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231230162912.827669-1-jacopo.mondi@ideasonboard.com> References: <20231230162912.827669-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/7] 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 Reviewed-by: Kieran Bingham --- 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);