{"id":10694,"url":"https://patchwork.libcamera.org/api/patches/10694/?format=json","web_url":"https://patchwork.libcamera.org/patch/10694/","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":"<20201222135849.38052-2-kieran.bingham@ideasonboard.com>","date":"2020-12-22T13:58:48","name":"[libcamera-devel,1/2] test: file: Check that directories are not treated as files","commit_ref":"8f4e16f014c820a0ecb85e28453b88c277bc859f","pull_url":null,"state":"accepted","archived":false,"hash":"b42b9ff36dd92a16975af918f485cc13b66b1438","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":{"id":11,"url":"https://patchwork.libcamera.org/api/users/11/?format=json","username":"kbingham","first_name":"Kieran","last_name":"Bingham","email":"kieran.bingham@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/10694/mbox/","series":[{"id":1540,"url":"https://patchwork.libcamera.org/api/series/1540/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1540","date":"2020-12-22T13:58:47","name":"libcamera: file: Don't parse directories","version":1,"mbox":"https://patchwork.libcamera.org/series/1540/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10694/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10694/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 2E942C0F1A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Dec 2020 13:58:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E4278615B1;\n\tTue, 22 Dec 2020 14:58:56 +0100 (CET)","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 E106E6158A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Dec 2020 14:58:54 +0100 (CET)","from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6BA24A1B;\n\tTue, 22 Dec 2020 14:58:54 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"P2FLc5/w\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1608645534;\n\tbh=OBNrnrqJW2DnMs6EmJ5KgbhJTJpvqM8D+XBPKjpj6dU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=P2FLc5/wWnZefv7+YiDyQPL9IfDBLN79qCjawNESkbnwlchEPHJnfaTLj3uWfHXFT\n\tdULD3jQt1IaZBBJEdcvhUqfIGwdnnXWlVy/qHhwUaWg0vZ3mKxp/xC0TaZZYR56uTG\n\trnpUmezWyuqmXOmUu7Fy3SG9peN9Veuzws645Vns=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Tue, 22 Dec 2020 13:58:48 +0000","Message-Id":"<20201222135849.38052-2-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20201222135849.38052-1-kieran.bingham@ideasonboard.com>","References":"<20201222135849.38052-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 1/2] test: file: Check that directories\n\tare not treated as files","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Directories can not be opened as a file, so the exists() check should\nnot return true for a path which points to a directory.\n\nDirectories are not handled by the File class.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/file.cpp | 5 +++++\n 1 file changed, 5 insertions(+)","diff":"diff --git a/test/file.cpp b/test/file.cpp\nindex f458f355ccad..b80667ae5b2f 100644\n--- a/test/file.cpp\n+++ b/test/file.cpp\n@@ -49,6 +49,11 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\tif (File::exists(\"/dev\")) {\n+\t\t\tcerr << \"Directories should not be treated as files\" << endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n \t\t/* Test unnamed file. */\n \t\tFile file;\n \n","prefixes":["libcamera-devel","1/2"]}