From patchwork Fri Dec 22 16:40:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 19339 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 BD50DC31E9 for ; Fri, 22 Dec 2023 16:40:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D3C0462B31; Fri, 22 Dec 2023 17:40:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1703263253; 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=4LMUBt6QkyVVl6RyDyNt6wB698ueMKXZPP/SBzd0MJXbhMoWy1s1hNtidaGu2qBM/ BSBTQgA1wQv8HeXS+U81vf/5W1XNafJ+ZEI4+lP4ORfbwgueTfi5cV3vXsrlP/E+qz i8L/orxu2IELszwnFSEGmxTVzDbla2YItCtmhK3JljX3sY85xbuJF8AgWX0QFz866O +I3MKRe8Bt5CYSRpkK2EtIg9cic80FNwtEhfwrM/F4TWhZhzOxCN5qSm8zVEVIBJnZ cKMhu0IAJXg04bTYMCPLFVGzaI3hC3Iyh7xk0qPDLPn6sitlKh6iO1FY14jHM+KvPN Xmi7O6DELqjFg== 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 C117361D8F for ; Fri, 22 Dec 2023 17:40:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wErTc24o"; 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 DB645BB2; Fri, 22 Dec 2023 17:39:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1703263198; bh=qneqtV9quvOjU67kpSxwhaJzfrt4bucT1eOPM/MgTvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wErTc24o8k/zP/1AsOUaAEPpNa5rjqA+LsA+vx6P/PDrWN6Cr7PZlFClO8iVYxahH McUchmxiSP8hYbcpYanf60F9zFDkh6dUs+z4Bq7UkBiZfKIWkogH2MepIRbldCRkov h7a6zvGn44FpWgxI0zmhX8cs7VYLD9gFBJUyKhUE= To: libcamera-devel@lists.libcamera.org Date: Fri, 22 Dec 2023 17:40:33 +0100 Message-ID: <20231222164036.649245-3-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231222164036.649245-1-jacopo.mondi@ideasonboard.com> References: <20231222164036.649245-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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);