From patchwork Wed Dec 28 22:30:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 18074 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 0DC08C3220 for ; Wed, 28 Dec 2022 22:30:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BA02E625EA; Wed, 28 Dec 2022 23:30:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1672266645; bh=mf9lLD2HWERLMm1bvaPiXYY+T6Bud9wv1LwIPxTz7ag=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wYfW//2iW3qnmfKJXEVk8sJGGgWh1xlVEfsQoGhU6nuA4ESbiVoDpokrgBwiJtQlJ 3CEA58On132M5lxaYz5Rj1nH+iT2JtfhOFB/F6UV3LDo4aQiw5L8za5QCtw5K90FqH IZDP3lCkvVt6hBgQig11gJCv2XmDt2oodyfl6kWrGVta9d2MzKSSSnIkfCUY+KzSqB 1cEVjWFZjDJhEUG8gzyjED8UndRaQFHaOoyLP7THPEziukHZt4MD9PBoWirY6d9fiC dSsEkbNXtEpz9y4WJNsG+cDEOefmZ03Zpw7OY7uWC538IAOxdToZY7bfpNAber4Hgl d0zql4VSLkoow== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AE9E3625DC for ; Wed, 28 Dec 2022 23:30:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Cjlm91pd"; dkim-atps=neutral Received: from pyrite.mediacom.info (unknown [IPv6:2604:2d80:ad8a:9000:1bf9:855b:22de:3645]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 62CD16D0; Wed, 28 Dec 2022 23:30:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1672266640; bh=mf9lLD2HWERLMm1bvaPiXYY+T6Bud9wv1LwIPxTz7ag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cjlm91pdcPEJajJ3jO3DKWwvIHKHr5hQjGnJcKYc/FXdeGVuSdKkPXJLb9V90785F stFWFYmc+WLum0nyFP/8UK1AVVEbsD2yiFx7tbyAQ1QeXJOLIGcb30d7EXtc/URQ8b +3CUH7YbOgGKatEX9vz7AY0gunAlq0NJOX2I1elk= To: libcamera-devel@lists.libcamera.org Date: Wed, 28 Dec 2022 16:30:02 -0600 Message-Id: <20221228223003.2265712-19-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221228223003.2265712-1-paul.elder@ideasonboard.com> References: <20221228223003.2265712-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v10 18/19] 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: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder 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 --- Changes in v9: - rebased 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/apps/lc-compliance/simple_capture.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/apps/lc-compliance/simple_capture.cpp b/src/apps/lc-compliance/simple_capture.cpp index a37a98ac..02b00d9a 100644 --- a/src/apps/lc-compliance/simple_capture.cpp +++ b/src/apps/lc-compliance/simple_capture.cpp @@ -164,6 +164,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; @@ -201,6 +204,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); @@ -232,5 +238,8 @@ void SimpleCaptureOverflow::capture() void SimpleCaptureOverflow::requestComplete([[maybe_unused]] Request *request) { + EXPECT_EQ(request->status(), Request::Status::RequestComplete) + << "Request didn't complete successfully"; + captureCompleted(); }