From patchwork Thu Apr 23 23:00:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26547 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 C31D1BDCB5 for ; Thu, 23 Apr 2026 23:01:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 520E362FD5; Fri, 24 Apr 2026 01:01:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mK5IG2ry"; 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 050FA62FAC for ; Fri, 24 Apr 2026 01:01:36 +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 ESMTPSA id 8C3EF1283 for ; Fri, 24 Apr 2026 00:59:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1776985196; bh=WqWLJCGJml0Nk3UlPb6N/1Ev9Wt3aIz9ZnwJotPZztg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mK5IG2ryqnDxL/uphQh/dtNiTU8zwaQKeEcfpxHyac4AfOY8al5xfPjvQ38baxk3t WNtLvI/ILRg2fQRkkiSl+2KgvTP5IDwferOcbTqj1+1bnoggIdsh1Ptd57vmb1ywD+ DxTs5MaUoA6SYWHEwXxHLc6P37Do5iKvrIL/H2oQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v3 25/37] test: yaml-parser: Replace "object" with "node" Date: Fri, 24 Apr 2026 02:00:47 +0300 Message-ID: <20260423230059.3180987-26-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260423230059.3180987-1-laurent.pinchart@ideasonboard.com> References: <20260423230059.3180987-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 Reviewed-by: Barnabás Pőcze Reviewed-by: Isaac Scott --- 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 a4b26c17e1f9..307e4ee26c68 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 failed to parse as Dictionary" << std::endl; + if (!level1Node.isDictionary()) { + std::cerr << "level1 node failed 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 element list" << std::endl; + if (!level2Node.isList() || level2Node.size() != 2) { + std::cerr << "level2 node should be a 2 element 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 failed to parse as integer list" << std::endl; + std::cerr << "The first element of level2 node failed 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 failed to parse as dictionary" << std::endl; + std::cerr << "The second element of level2 node failed to parse as dictionary" << std::endl; return TestFail; }