{"id":26469,"url":"https://patchwork.libcamera.org/api/1.1/patches/26469/?format=json","web_url":"https://patchwork.libcamera.org/patch/26469/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260407153427.1825999-30-laurent.pinchart@ideasonboard.com>","date":"2026-04-07T15:34:14","name":"[v2,29/42] test: yaml-parser: Standardize on explicitly qualifying std namespace","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f57e79566b936040cee014e7b9713a91e4f75aec","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/26469/mbox/","series":[{"id":5873,"url":"https://patchwork.libcamera.org/api/1.1/series/5873/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5873","date":"2026-04-07T15:33:45","name":"libcamera: Global configuration file improvements","version":2,"mbox":"https://patchwork.libcamera.org/series/5873/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/26469/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/26469/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 C1ED7C331D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Apr 2026 15:35:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 052B862E3D;\n\tTue,  7 Apr 2026 17:35:14 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 988A462E36\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Apr 2026 17:35:08 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 11D55A30\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Apr 2026 17:33:41 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"AIf4hIJn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1775576021;\n\tbh=E8G5dU8Wcu8VzDRpVpi+VQ97VML0mZ5vya9frb5Xnuc=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=AIf4hIJnlMrZsoO8CEirgLVqNubq+fvKfGmQz8qPGCGojD/jU75El6YW489/zCihY\n\tS4Ced3Vap23cUtG1/KvW2AT9d4/su3zIrdx9ON2snxaUlkx3vPyLZU6pULfBsp+IpG\n\t+qPR1m+iKJo8yGoAX8UqHMkid7rK02RJUuHozsaY=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v2 29/42] test: yaml-parser: Standardize on explicitly\n\tqualifying std namespace","Date":"Tue,  7 Apr 2026 18:34:14 +0300","Message-ID":"<20260407153427.1825999-30-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","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"yaml-parser.cpp mixes unqualified and qualified identifier in the std\nnamespace. Standardize on qualified identifiers, and drop the\n\"using namespace std\" statement.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/yaml-parser.cpp | 35 +++++++++++++++++------------------\n 1 file changed, 17 insertions(+), 18 deletions(-)","diff":"diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp\nindex 0bbda3af8ea9..e8fd9ad61cd0 100644\n--- a/test/yaml-parser.cpp\n+++ b/test/yaml-parser.cpp\n@@ -20,9 +20,8 @@\n #include \"test.h\"\n \n using namespace libcamera;\n-using namespace std;\n \n-static const string testYaml =\n+static const std::string testYaml =\n \t\"empty:\\n\"\n \t\"value: 42\\n\"\n \t\"list:\\n\"\n@@ -34,13 +33,13 @@ static const string testYaml =\n \t\"    - [1, 2]\\n\"\n \t\"    - {one: 1, two: 2}\\n\";\n \n-static const string invalidYaml =\n+static const std::string invalidYaml =\n \t\"Invalid : - YAML : - Content\";\n \n class YamlParserTest : public Test\n {\n protected:\n-\tbool createFile(const string &content, string &filename)\n+\tbool createFile(const std::string &content, std::string &filename)\n \t{\n \t\tfilename = \"/tmp/libcamera.test.XXXXXX\";\n \t\tint fd = mkstemp(&filename.front());\n@@ -72,13 +71,13 @@ protected:\n \t\t/* Test parsing invalid YAML file. */\n \t\tFile file{ invalidYamlFile_ };\n \t\tif (!file.open(File::OpenModeFlag::ReadOnly)) {\n-\t\t\tcerr << \"Fail to open invalid YAML file\" << std::endl;\n+\t\t\tstd::cerr << \"Fail to open invalid YAML file\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n \t\tstd::unique_ptr<ValueNode> root = YamlParser::parse(file);\n \t\tif (root) {\n-\t\t\tcerr << \"Invalid YAML file parse successfully\" << std::endl;\n+\t\t\tstd::cerr << \"Invalid YAML file parse successfully\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n@@ -86,20 +85,20 @@ protected:\n \t\tfile.close();\n \t\tfile.setFileName(testYamlFile_);\n \t\tif (!file.open(File::OpenModeFlag::ReadOnly)) {\n-\t\t\tcerr << \"Fail to open test YAML file\" << std::endl;\n+\t\t\tstd::cerr << \"Fail to open test YAML file\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n \t\troot = YamlParser::parse(file);\n \n \t\tif (!root) {\n-\t\t\tcerr << \"Fail to parse test YAML file: \" << std::endl;\n+\t\t\tstd::cerr << \"Fail to parse test YAML file: \" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n \t\t/* Test that the root dictionary node has been parsed correctly. */\n \t\tif (!root->isDictionary()) {\n-\t\t\tcerr << \"Dictionary node has wrong type\" << std::endl;\n+\t\t\tstd::cerr << \"Dictionary node has wrong type\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n@@ -138,7 +137,7 @@ protected:\n \t\t/* Test empty node. */\n \t\tauto &emptyNode = (*root)[\"empty\"];\n \n-\t\tif (emptyNode.get<string>(\"-\") != \"\") {\n+\t\tif (emptyNode.get<std::string>(\"-\") != \"\") {\n \t\t\tstd::cerr << \"Empty node has incorrect content\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n@@ -146,7 +145,7 @@ protected:\n \t\t/* Test value node. */\n \t\tauto &valueNode = (*root)[\"value\"];\n \n-\t\tif (valueNode.get<string>(\"\") != \"42\") {\n+\t\tif (valueNode.get<std::string>(\"\") != \"42\") {\n \t\t\tstd::cerr << \"Value node has incorrect content\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n@@ -161,7 +160,7 @@ protected:\n \t\t};\n \n \t\tif (listObj.size() != listValues.size()) {\n-\t\t\tcerr << \"List object parse with wrong size\" << std::endl;\n+\t\t\tstd::cerr << \"List object parsed with wrong size\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n@@ -192,7 +191,7 @@ protected:\n \n \t\t/* Ensure that empty list elements get parsed as empty strings. */\n \t\tif (!listObj[2].isValue()) {\n-\t\t\tcerr << \"Empty list element is not a value\" << std::endl;\n+\t\t\tstd::cerr << \"Empty list element is not a value\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n@@ -200,14 +199,14 @@ protected:\n \t\tauto &level1Obj = (*root)[\"level1\"];\n \n \t\tif (!level1Obj.isDictionary()) {\n-\t\t\tcerr << \"level1 object fail to parse as Dictionary\" << std::endl;\n+\t\t\tstd::cerr << \"level1 object fail to parse as Dictionary\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n \t\tauto &level2Obj = level1Obj[\"level2\"];\n \n \t\tif (!level2Obj.isList() || level2Obj.size() != 2) {\n-\t\t\tcerr << \"level2 object should be a 2 elements list\" << std::endl;\n+\t\t\tstd::cerr << \"level2 object should be a 2 elements list\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n@@ -216,13 +215,13 @@ protected:\n \t\t    firstElement.size() != 2 ||\n \t\t    firstElement[0].get<int32_t>(0) != 1 ||\n \t\t    firstElement[1].get<int32_t>(0) != 2) {\n-\t\t\tcerr << \"The first element of level2 object fail to parse as integer list\" << std::endl;\n+\t\t\tstd::cerr << \"The first element of level2 object fail to parse as integer list\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n \t\tconst auto &values = firstElement.get<std::vector<uint16_t>>();\n \t\tif (!values || values->size() != 2 || (*values)[0] != 1 || (*values)[1] != 2) {\n-\t\t\tcerr << \"get() failed to return correct vector\" << std::endl;\n+\t\t\tstd::cerr << \"get() failed to return correct vector\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n@@ -232,7 +231,7 @@ protected:\n \t\t    !secondElement.contains(\"two\") ||\n \t\t    secondElement[\"one\"].get<int32_t>(0) != 1 ||\n \t\t    secondElement[\"two\"].get<int32_t>(0) != 2) {\n-\t\t\tcerr << \"The second element of level2 object fail to parse as dictionary\" << std::endl;\n+\t\t\tstd::cerr << \"The second element of level2 object fail to parse as dictionary\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n","prefixes":["v2","29/42"]}