Patch Detail
Show a patch.
GET /api/patches/16876/?format=api
{ "id": 16876, "url": "https://patchwork.libcamera.org/api/patches/16876/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16876/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20220730132027.20679-1-laurent.pinchart@ideasonboard.com>", "date": "2022-07-30T13:20:27", "name": "[libcamera-devel] test: yaml-parser: Test YamlObject::get(const T &defaultValue)", "commit_ref": "90906ba7fb95490abefa9bcbea812b4e2ff8dbdc", "pull_url": null, "state": "accepted", "archived": false, "hash": "8f053f6757de0b197d9973b1af56f8c84e2e13dd", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/16876/mbox/", "series": [ { "id": 3351, "url": "https://patchwork.libcamera.org/api/series/3351/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3351", "date": "2022-07-30T13:20:27", "name": "[libcamera-devel] test: yaml-parser: Test YamlObject::get(const T &defaultValue)", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3351/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16876/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16876/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 98BA0C3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 30 Jul 2022 13:20:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 483E663315;\n\tSat, 30 Jul 2022 15:20:31 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA453603EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 30 Jul 2022 15:20:29 +0200 (CEST)", "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 880BF480;\n\tSat, 30 Jul 2022 15:20:29 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659187231;\n\tbh=d8H9oX+K/LFSVw26J1/OlLC7BPf3qKl0RcNRUGiml20=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=AP6kT6EPcKvAdHVAuxvO1Ce3jPN/ZeR+7ZaZnYL2ZPl55gLjXKba/84h84FWNw93q\n\teg72KmUQF63s6BJwKppNflNEsWFvcwoblCXEiEaPDIrmbSVo6MQT3SO4hOXEX7Q+Vo\n\ty2rV/wV31nLkypVNu1I1ck2jW+KKBm9QXitCxnS4uMLLWllxETM/+YXbHkwkEDIlxS\n\tLlmZCBxNp20cjhft4ReB+LFTsmvhv+SpDt32Gd4Bk2iGkjOJtjmG9YwTjeTEbjCLuV\n\tx0/zZVhKIbULweBEZWRwmPBCad0Gm73xVgJT3S+ZH+Dmmak9/LkjlI/LRs4M0nBbrg\n\tlmkyI/FA/X3Zg==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659187229;\n\tbh=d8H9oX+K/LFSVw26J1/OlLC7BPf3qKl0RcNRUGiml20=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=Ziy+e8+R4ETwZTkqcVVrWayQstgglsY+jfJad/vqr7y1EbsNrZlEhb9NQd4x0mvfl\n\t7ANbQ228ckr65fEy4zQYwHlopbMyH3VEXwVUsa5cueWYtuSOfet8QCTadwsyMkshyb\n\t+r9zknPlr5xaktphDq+hhIMCLMxmbDYn39dI0rpk=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Ziy+e8+R\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 30 Jul 2022 16:20:27 +0300", "Message-Id": "<20220730132027.20679-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] test: yaml-parser: Test\n\tYamlObject::get(const T &defaultValue)", "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": "When the YamlObject::get() function override that returns a\nstd::optional got introduced, all tests were moved to it, leaving no\ntests for the override that takes a default value. Reintroduce those\ntests.\n\nReported-by: Florian Sylvestre <fsylvestre@baylibre.com>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/yaml-parser.cpp | 33 ++++++++++++++++++++++-----------\n 1 file changed, 22 insertions(+), 11 deletions(-)\n\n\nbase-commit: 69ae75b0cc211f82665b3e92fb3de64a9852b403", "diff": "diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp\nindex 9fd278664b3b..93ba88b8bcd5 100644\n--- a/test/yaml-parser.cpp\n+++ b/test/yaml-parser.cpp\n@@ -160,7 +160,8 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (strObj.get<string>().value_or(\"\") != \"libcamera\") {\n+\t\tif (strObj.get<string>().value_or(\"\") != \"libcamera\" ||\n+\t\t strObj.get<string>(\"\") != \"libcamera\") {\n \t\t\tcerr << \"String object parse as wrong content\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n@@ -198,17 +199,20 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (int32Obj.get<int32_t>().value_or(0) != -100) {\n+\t\tif (int32Obj.get<int32_t>().value_or(0) != -100 ||\n+\t\t int32Obj.get<int32_t>(0) != -100) {\n \t\t\tcerr << \"Integer object parse as wrong value\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (int32Obj.get<string>().value_or(\"\") != \"-100\") {\n+\t\tif (int32Obj.get<string>().value_or(\"\") != \"-100\" ||\n+\t\t int32Obj.get<string>(\"\") != \"-100\") {\n \t\t\tcerr << \"Integer object fail to parse as string\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (int32Obj.get<double>().value_or(0.0) != -100.0) {\n+\t\tif (int32Obj.get<double>().value_or(0.0) != -100.0 ||\n+\t\t int32Obj.get<double>(0.0) != -100.0) {\n \t\t\tcerr << \"Integer object fail to parse as double\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n@@ -236,22 +240,26 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (uint32Obj.get<int32_t>().value_or(0) != 100) {\n+\t\tif (uint32Obj.get<int32_t>().value_or(0) != 100 ||\n+\t\t uint32Obj.get<int32_t>(0) != 100) {\n \t\t\tcerr << \"Unsigned integer object fail to parse as integer\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (uint32Obj.get<string>().value_or(\"\") != \"100\") {\n+\t\tif (uint32Obj.get<string>().value_or(\"\") != \"100\" ||\n+\t\t uint32Obj.get<string>(\"\") != \"100\") {\n \t\t\tcerr << \"Unsigned integer object fail to parse as string\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (uint32Obj.get<double>().value_or(0.0) != 100.0) {\n+\t\tif (uint32Obj.get<double>().value_or(0.0) != 100.0 ||\n+\t\t uint32Obj.get<double>(0.0) != 100.0) {\n \t\t\tcerr << \"Unsigned integer object fail to parse as double\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (uint32Obj.get<uint32_t>().value_or(0) != 100) {\n+\t\tif (uint32Obj.get<uint32_t>().value_or(0) != 100 ||\n+\t\t uint32Obj.get<uint32_t>(0) != 100) {\n \t\t\tcerr << \"Unsigned integer object parsed as wrong value\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n@@ -274,12 +282,14 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (doubleObj.get<string>().value_or(\"\") != \"3.14159\") {\n+\t\tif (doubleObj.get<string>().value_or(\"\") != \"3.14159\" ||\n+\t\t doubleObj.get<string>(\"\") != \"3.14159\") {\n \t\t\tcerr << \"Double object fail to parse as string\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (doubleObj.get<double>().value_or(0.0) != 3.14159) {\n+\t\tif (doubleObj.get<double>().value_or(0.0) != 3.14159 ||\n+\t\t doubleObj.get<double>(0.0) != 3.14159) {\n \t\t\tcerr << \"Double object parse as wrong value\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n@@ -332,7 +342,8 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tif (sizeObj.get<Size>().value_or(Size(0, 0)) != Size(1920, 1080)) {\n+\t\tif (sizeObj.get<Size>().value_or(Size(0, 0)) != Size(1920, 1080) ||\n+\t\t sizeObj.get<Size>(Size(0, 0)) != Size(1920, 1080)) {\n \t\t\tcerr << \"Size object parse as wrong value\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n", "prefixes": [ "libcamera-devel" ] }