From patchwork Tue Apr 7 15:34:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26470 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 74A25C32F6 for ; Tue, 7 Apr 2026 15:35:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 11FD462E49; Tue, 7 Apr 2026 17:35:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Kw2yoNGS"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ED12762E34 for ; Tue, 7 Apr 2026 17:35:09 +0200 (CEST) Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 632FA6A6 for ; Tue, 7 Apr 2026 17:33:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1775576022; bh=iAl7Uhf4ozNMtd1aKDUtx6PDQo9FCvFjccikshDLOhc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Kw2yoNGShZ3T4VrBigHDU5WUA7tFIvFyjrPNDKfXLV8kHUPoRKj29lMmpPp8X6y54 ktshTXO8ER5ZqO3Ginxj6oxP3xZP73Z1PP/drem0LTr5/0WKgwzSuIRQeGqJ5RKIc6 lAgU4ApwKFJ98hsIiLH1uU7TGFZhjIG2/EY3JSs0= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 30/42] test: yaml-parser: Replace "object" with "node" Date: Tue, 7 Apr 2026 18:34:15 +0300 Message-ID: <20260407153427.1825999-31-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260407153427.1825999-1-laurent.pinchart@ideasonboard.com> References: <20260407153427.1825999-1-laurent.pinchart@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" Now that the storage class for the property tree storing data parsed from YAML has been renamed from YamlObject to ValueNode, rename variables and update error messages accordingly. Signed-off-by: Laurent Pinchart --- test/yaml-parser.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp index e8fd9ad61cd0..c8ef51fe18aa 100644 --- a/test/yaml-parser.cpp +++ b/test/yaml-parser.cpp @@ -151,7 +151,7 @@ protected: } /* Test list node. */ - auto &listObj = (*root)["list"]; + auto &listNode = (*root)["list"]; static constexpr std::array listValues{ "libcamera", @@ -159,13 +159,13 @@ protected: "", }; - if (listObj.size() != listValues.size()) { - std::cerr << "List object parsed with wrong size" << std::endl; + if (listNode.size() != listValues.size()) { + std::cerr << "List node parsed with wrong size" << std::endl; return TestFail; } unsigned int i = 0; - for (auto &elem : listObj.asList()) { + for (auto &elem : listNode.asList()) { if (i >= listValues.size()) { std::cerr << "Too many elements in list during iteration" << std::endl; @@ -174,7 +174,7 @@ protected: std::string value = listValues[i]; - if (&elem != &listObj[i]) { + if (&elem != &listNode[i]) { std::cerr << "List element " << i << " has wrong address" << std::endl; return TestFail; @@ -190,32 +190,32 @@ protected: } /* Ensure that empty list elements get parsed as empty strings. */ - if (!listObj[2].isValue()) { + if (!listNode[2].isValue()) { std::cerr << "Empty list element is not a value" << std::endl; return TestFail; } /* Test nested nodes. */ - auto &level1Obj = (*root)["level1"]; + auto &level1Node = (*root)["level1"]; - if (!level1Obj.isDictionary()) { - std::cerr << "level1 object fail to parse as Dictionary" << std::endl; + if (!level1Node.isDictionary()) { + std::cerr << "level1 node fail to parse as Dictionary" << std::endl; return TestFail; } - auto &level2Obj = level1Obj["level2"]; + auto &level2Node = level1Node["level2"]; - if (!level2Obj.isList() || level2Obj.size() != 2) { - std::cerr << "level2 object should be a 2 elements list" << std::endl; + if (!level2Node.isList() || level2Node.size() != 2) { + std::cerr << "level2 node should be a 2 elements list" << std::endl; return TestFail; } - auto &firstElement = level2Obj[0]; + auto &firstElement = level2Node[0]; if (!firstElement.isList() || firstElement.size() != 2 || firstElement[0].get(0) != 1 || firstElement[1].get(0) != 2) { - std::cerr << "The first element of level2 object fail to parse as integer list" << std::endl; + std::cerr << "The first element of level2 node fail to parse as integer list" << std::endl; return TestFail; } @@ -225,13 +225,13 @@ protected: return TestFail; } - auto &secondElement = level2Obj[1]; + auto &secondElement = level2Node[1]; if (!secondElement.isDictionary() || !secondElement.contains("one") || !secondElement.contains("two") || secondElement["one"].get(0) != 1 || secondElement["two"].get(0) != 2) { - std::cerr << "The second element of level2 object fail to parse as dictionary" << std::endl; + std::cerr << "The second element of level2 node fail to parse as dictionary" << std::endl; return TestFail; }