{"id":26545,"url":"https://patchwork.libcamera.org/api/patches/26545/?format=json","web_url":"https://patchwork.libcamera.org/patch/26545/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20260423230059.3180987-24-laurent.pinchart@ideasonboard.com>","date":"2026-04-23T23:00:45","name":"[v3,23/37] test: yaml-parser: Standardize on explicitly qualifying std namespace","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f57e79566b936040cee014e7b9713a91e4f75aec","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/26545/mbox/","series":[{"id":5883,"url":"https://patchwork.libcamera.org/api/series/5883/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5883","date":"2026-04-23T23:00:22","name":"libcamera: Global configuration file improvements","version":3,"mbox":"https://patchwork.libcamera.org/series/5883/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/26545/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/26545/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 1FADDBDCB5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Apr 2026 23:01:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B389E62FC0;\n\tFri, 24 Apr 2026 01:01:49 +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 39E4162FB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Apr 2026 01:01:33 +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 ESMTPSA id B07929A6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Apr 2026 00:59:53 +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=\"wVchW+iv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1776985193;\n\tbh=qN/E1WOQoRc87dPE4+En60WJoPjE9JopEEcXDStN1ms=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=wVchW+ivDaEeBOhKrmEGVWzO7Mjy50POgc2S7o4va2jRg8Hvz46SHJ1mbGQAers1P\n\tTf/4KqZVrqhCTgR+BrQTWspqgY+zaEE44LhHmZEoy1iGrPoA0jRgPIxG8l17j9bHg+\n\tXFkDOnX9oODkA23sWIzwQe+QaVk7ax9xdAGcoU08=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v3 23/37] test: yaml-parser: Standardize on explicitly\n\tqualifying std namespace","Date":"Fri, 24 Apr 2026 02:00:45 +0300","Message-ID":"<20260423230059.3180987-24-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","Content-Type":"text/plain; charset=UTF-8","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>\nReviewed-by: Barnabás Pőcze <barnabas.pocze@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":["v3","23/37"]}