From patchwork Fri Jun 13 10:09:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 23559 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 21C81BDE6B for ; Fri, 13 Jun 2025 10:10:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9021B68DC7; Fri, 13 Jun 2025 12:10:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ndDLRsL1"; dkim-atps=neutral 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 9E05868DC3 for ; Fri, 13 Jun 2025 12:10:12 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:37bc:6352:9b26:2f94]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 4E08F56D; Fri, 13 Jun 2025 12:10:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1749809403; bh=ulq+YLUIGfWaIQjjeAz+yVVdBZ7kRa/LyZPLVKOxARY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ndDLRsL1TNZ9pMkY4SSJ+lCiUr3J1hA2ye/ro3oP2ePSNjJ0srRZOCbF3hyiG2gaA zUPJXqqsJEMYuUEEi0VF+sRXV0S5v+MfRMih5pzkXA0ZLJJ274ltlwXVx+qJbhA4HK /Ee8pGYH4CXOU6mlpYZM7fyQUkbv9kuzXGgl/ws8= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham Subject: [PATCH v2 3/4] test: ipa: Add failing test for single point Pwl Date: Fri, 13 Jun 2025 12:09:38 +0200 Message-ID: <20250613100947.589875-4-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250613100947.589875-1-stefan.klug@ideasonboard.com> References: <20250613100947.589875-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Sometimes it is useful to have a Pwl with only a single point defined. A practical use case is tuning files with only a single entry for Pwl related parameters, where the expectation is that this entry just gets used. Add a failing test case for such a single point Pwl. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham --- test/ipa/libipa/meson.build | 2 +- test/ipa/libipa/pwl.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/ipa/libipa/meson.build b/test/ipa/libipa/meson.build index b2cc4b7461c1..c553366a7934 100644 --- a/test/ipa/libipa/meson.build +++ b/test/ipa/libipa/meson.build @@ -4,7 +4,7 @@ libipa_test = [ {'name': 'fixedpoint', 'sources': ['fixedpoint.cpp']}, {'name': 'histogram', 'sources': ['histogram.cpp']}, {'name': 'interpolator', 'sources': ['interpolator.cpp']}, - {'name': 'pwl', 'sources': ['pwl.cpp']}, + {'name': 'pwl', 'sources': ['pwl.cpp'], 'should_fail': true }, ] foreach test : libipa_test diff --git a/test/ipa/libipa/pwl.cpp b/test/ipa/libipa/pwl.cpp index d41a290a0e84..6640b1ab9f36 100644 --- a/test/ipa/libipa/pwl.cpp +++ b/test/ipa/libipa/pwl.cpp @@ -43,6 +43,13 @@ protected: ASSERT_EQ(pwl.size(), 2); + /* Test degenerate PWL. */ + pwl.clear(); + pwl.append(1, 1); + ASSERT_EQ(pwl.eval(0), 1); + ASSERT_EQ(pwl.eval(1), 1); + ASSERT_EQ(pwl.eval(2), 1); + return TestPass; } };