From patchwork Fri Dec 16 12:29:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 18031 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 F117BC31E9 for ; Fri, 16 Dec 2022 12:30:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ABEEA633B2; Fri, 16 Dec 2022 13:30:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1671193833; 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=ynYB5TmvdGasThu/YHb5ib11+82QUx2DVUipuuVKpLpHbsYEgAZ6vOcDEmt0Q2j0R VWvY2swdCliP+HYTOPmMb7HdEG9tDYcK4ib+IUFqXXZUgVZKYVGwcsJ8ohm2XyB/bf dW4aGWsFtxi+zKcFoXE4Fh1fIFxv45rQnoWceKWPxWAyM+i0u2G3AgH2bInobLT9P6 Uk4+QIZoVl4wT5GDza6Usa7zrtS+7VgGtqukYyuqcRX4M/7HDFCiYW3aAXorlT3Mxa TuwqmNnro2VvL7GaGQafgHpOfIi/dM/wMm6wRBQV8cXX7n/hWaRyPla5xcB/i5LJCg L7qEZwKnTEeWg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 25C1063360 for ; Fri, 16 Dec 2022 13:30:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="p/O7DIst"; dkim-atps=neutral Received: from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B391C128D; Fri, 16 Dec 2022 13:30:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1671193831; bh=mf9lLD2HWERLMm1bvaPiXYY+T6Bud9wv1LwIPxTz7ag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p/O7DIst/tq5cAAfS+tiLcSX6wOFEUsHkqR9Hjhg0X6B3kA935KyNayEBBeUYCOBo kfbmwX4ZjJ/WtqsVXnltYFlTOzjjHMMONWsQwGP2hN5wAlu9g0o6c0Oo1DZxFBp/LS P7yS7OkoCPxbFmvZnvQb41E4NZXAdDuF1s9x7DHs= To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Dec 2022 21:29:38 +0900 Message-Id: <20221216122939.256534-18-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221216122939.256534-1-paul.elder@ideasonboard.com> References: <20221216122939.256534-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v9 17/18] 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(); }