Patch Detail
Show a patch.
GET /api/1.1/patches/16245/?format=api
{ "id": 16245, "url": "https://patchwork.libcamera.org/api/1.1/patches/16245/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16245/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220616150535.21742-2-laurent.pinchart@ideasonboard.com>", "date": "2022-06-16T15:05:32", "name": "[libcamera-devel,RFC,v3,1/4] test: yaml-parser: Test dictionary items ordering", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d89c593b2871d55f929b50b449389f1e48112f49", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/16245/mbox/", "series": [ { "id": 3182, "url": "https://patchwork.libcamera.org/api/1.1/series/3182/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3182", "date": "2022-06-16T15:05:31", "name": "Replace boost JSON parser with libyaml in Raspberry Pi IPA", "version": 3, "mbox": "https://patchwork.libcamera.org/series/3182/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16245/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16245/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 12632C3273\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Jun 2022 15:05:53 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8B5165638;\n\tThu, 16 Jun 2022 17:05:51 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B87F8600F0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Jun 2022 17:05:49 +0200 (CEST)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C9B7898;\n\tThu, 16 Jun 2022 17:05:49 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655391951;\n\tbh=g9RCsvd/j89k9yRTVP8zmBiokpMe5cM4JFkmkynKt1M=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Fp3/5xt4Fypob7lqKtjgcmlZ0MAvpIx8nHJ/3O0fPEy7ZKGFn83mpPGw8UokdmtlU\n\tgdiLD7Per3X2Y0LTU6FPSXGfZ6GwyvEomhkusNbCUg4rl/AXFgpsjX8jTR+i+tOxBs\n\t8YFTr4TPBLp5cd5b7Cjl/BRypU3AXy07RIQNo8AhsPoTbvc/aejrbUNUfuX/lwIH7T\n\tlRWslRPvMeN1/8c6fh85YJwgV6AWzxxPnvyOLKj/6Igs1ZE2FOcOUR6njfFIPmesVt\n\tVWBQLwMw+//YJyUggsZTW4MreJ8IF4HzBSWZbWvjuHB8BtL7l3wLR69t0uq4FXFFvK\n\tjU26BVOHje4IQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1655391949;\n\tbh=g9RCsvd/j89k9yRTVP8zmBiokpMe5cM4JFkmkynKt1M=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=KzbcyI0W5UrL157oUXUcKInHn1p764jOiYyD5i0rPTeMMWleJCUIU0uc47CMSIM26\n\t8W6WKm5gsDJGDt+2XT8X2n7LJdjPLUzv6t3n5J8yYQE1NHwtSadEAtXPRMH0SujQP0\n\twqbbJY0C4otcF4X3jp3Pl26H8IZNKpPNZrnhNX/k=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"KzbcyI0W\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 16 Jun 2022 18:05:32 +0300", "Message-Id": "<20220616150535.21742-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20220616150535.21742-1-laurent.pinchart@ideasonboard.com>", "References": "<20220616150535.21742-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [RFC PATCH v3 1/4] test: yaml-parser: Test\n\tdictionary items ordering", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "While YAML specifies that mappings are unordered, the Raspberry Pi IPA\nrelies on elements being ordered as in the YAML data. To replace the\ndependency on boost with the YamlParser class, we thus need to guarantee\nthat the order is preserved. Update the corresponding unit test to\nensure this. The test currently fails at the YamlParser doesn't\ncorrectly preserve the order, this will be fixed by the next commit.\n\nThis commit should be reverted when the Raspberry Pi IPA updates to a\nnew tuning data format and drops support for the old format.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/yaml-parser.cpp | 17 ++++++-----------\n 1 file changed, 6 insertions(+), 11 deletions(-)", "diff": "diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp\nindex 38f848232fa6..157ecea256cd 100644\n--- a/test/yaml-parser.cpp\n+++ b/test/yaml-parser.cpp\n@@ -32,8 +32,8 @@ static const string testYaml =\n \t\" - Mary\\n\"\n \t\"dictionary:\\n\"\n \t\" a: 1\\n\"\n-\t\" b: 2\\n\"\n \t\" c: 3\\n\"\n+\t\" b: 2\\n\"\n \t\"level1:\\n\"\n \t\" level2:\\n\"\n \t\" - [1, 2]\\n\"\n@@ -449,10 +449,10 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tstd::map<std::string, int> dictValues{ {\n+\t\tstatic constexpr std::array<std::pair<const char *, int>, 3> dictValues{ {\n \t\t\t{ \"a\", 1 },\n-\t\t\t{ \"b\", 2 },\n \t\t\t{ \"c\", 3 },\n+\t\t\t{ \"b\", 2 },\n \t\t} };\n \n \t\tsize_t dictSize = dictValues.size();\n@@ -470,8 +470,8 @@ protected:\n \t\t\t\treturn TestFail;\n \t\t\t}\n \n-\t\t\tconst auto item = dictValues.find(key);\n-\t\t\tif (item == dictValues.end()) {\n+\t\t\tconst auto &item = dictValues[i];\n+\t\t\tif (item.first != key) {\n \t\t\t\tstd::cerr << \"Dictionary key \" << i << \" has wrong value\"\n \t\t\t\t\t << std::endl;\n \t\t\t\treturn TestFail;\n@@ -483,17 +483,12 @@ protected:\n \t\t\t\treturn TestFail;\n \t\t\t}\n \n-\t\t\tif (elem.get<int32_t>(0) != item->second) {\n+\t\t\tif (elem.get<int32_t>(0) != item.second) {\n \t\t\t\tstd::cerr << \"Dictionary element \" << i << \" has wrong value\"\n \t\t\t\t\t << std::endl;\n \t\t\t\treturn TestFail;\n \t\t\t}\n \n-\t\t\t/*\n-\t\t\t * Erase the item to make sure that each iteration\n-\t\t\t * produces a different value.\n-\t\t\t */\n-\t\t\tdictValues.erase(item);\n \t\t\ti++;\n \t\t}\n \n", "prefixes": [ "libcamera-devel", "RFC", "v3", "1/4" ] }