From patchwork Sat Jun 4 18:59:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 16160 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 23E61C3276 for ; Sat, 4 Jun 2022 19:00:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 42E516563A; Sat, 4 Jun 2022 21:00:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654369206; bh=0ujFVweJ22FiMvPjHZ/GcIyK24KVDI3beDTIVi0P+Lc=; 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=f5bLRCbK+SUKd8YZ2KNj3QPVb6sQBnCNTqPRWpoKIm0jHOyF4RJ2qeZCbWQfV/n/W EB0xhu0Ejaqh6hfiPeNxQwBSwVH0iUZoCtKJ9x8ZtG+tgBaOnpb+rMm4fd33eYYXzz vcrq/03H6fIwusmfbxVF5u6VkP0/QYTFwDwrW9Uu5ZrrmQmNilf0qAkit1T7/wf/Sc hHMhhvS4Yw0TypJUi0L4YSmozmRKNX9ddsSZoYg1TlGqir+kVtl5hcNdV+I1A6A68X rQ/tvZy63nitIS54v6yeJjPoFnnLSYYkSWWcX22H+gQVUqAk0xB2SePm3QZztRGQ1e 1HxlUVEErLsZw== 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 BF5636563F for ; Sat, 4 Jun 2022 21:00:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="o36Z+NYv"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (85-76-79-203-nat.elisa-mobile.fi [85.76.79.203]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4BA586D4; Sat, 4 Jun 2022 21:00:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1654369204; bh=0ujFVweJ22FiMvPjHZ/GcIyK24KVDI3beDTIVi0P+Lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o36Z+NYvYRDFe+8bNluaGPWnCUQw77Ec7NhPZVETPXcXbh0ScT4v4EbL6DRNdU7NH HVzltu7WTxsUfJlaGAaltr11ArV6ZNpvGueGlzb9VQI9WbQTCFoYwOrb9TQT7hMjKM iqWUXRZ3PVgFzV8NxAi711KstFpMJbSxdIRuQKeE= To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jun 2022 21:59:30 +0300 Message-Id: <20220604185939.29163-6-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220604185939.29163-1-laurent.pinchart@ideasonboard.com> References: <20220604185939.29163-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2 05/14] test: yaml-parser: Test dictionary items ordering 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The order of items in a YAML dictionary may matter. Update the test to ensure that it is preserved. The test currently fails at the YamlParser doesn't correctly preserve the order, this will be fixed by the next commit. Signed-off-by: Laurent Pinchart --- test/yaml-parser.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp index 5ff4c3236dbf..582c9caed836 100644 --- a/test/yaml-parser.cpp +++ b/test/yaml-parser.cpp @@ -29,8 +29,8 @@ static const string testYaml = " - Mary\n" "dictionary:\n" " a: 1\n" - " b: 2\n" " c: 3\n" + " b: 2\n" "level1:\n" " level2:\n" " - [1, 2]\n" @@ -428,7 +428,6 @@ protected: } auto memeberNames = dictObj.memberNames(); - sort(memeberNames.begin(), memeberNames.end()); if (memeberNames.size() != 3) { cerr << "Dictionary object fail to extra member names" << std::endl; @@ -436,8 +435,8 @@ protected: } if (memeberNames[0] != "a" || - memeberNames[1] != "b" || - memeberNames[2] != "c") { + memeberNames[1] != "c" || + memeberNames[2] != "b") { cerr << "Dictionary object fail to parse member names" << std::endl; return TestFail; }