[{"id":28278,"web_url":"https://patchwork.libcamera.org/comment/28278/","msgid":"<170196645138.2829918.15756572480716947688@ping.linuxembedded.co.uk>","date":"2023-12-07T16:27:31","subject":"Re: [libcamera-devel] [PATCH 1/6] test: log: log_process: Log an\n\terror when failing due to incorrect message","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2023-12-06 21:05:19)\n> One of the error paths in the test returns without logging a message,\n> which makes failures difficult to debug. Fix it by adding an error\n> message.\n> \n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  test/log/log_process.cpp | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n> \n> diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp\n> index 966b80cf3af7..17af7d74a1d5 100644\n> --- a/test/log/log_process.cpp\n> +++ b/test/log/log_process.cpp\n> @@ -115,8 +115,11 @@ protected:\n>                 close(fd);\n>  \n>                 string str(buf);\n> -               if (str.find(message) == string::npos)\n> +               if (str.find(message) == string::npos) {\n> +                       cerr << \"Received message is not correct (received \"\n> +                            << str.length() << \" bytes)\" << endl;\n>                         return TestFail;\n> +               }\n>  \n>                 return TestPass;\n>         }\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","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 136ABC3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Dec 2023 16:27:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6755C629E7;\n\tThu,  7 Dec 2023 17:27:35 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9FA0261D99\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 Dec 2023 17:27:34 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 20FE7674;\n\tThu,  7 Dec 2023 17:26:53 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1701966455;\n\tbh=mrDNiyXNdN0Bo5GwwmUqpEnfYFwK5Sg73vnKVFkDQ9w=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=FwA8jgrGFnAnbbLizBq/BULvc/crVtVKR3OIvLLSRXlviXivDpblSblT0Nj4bo7B2\n\tmmkduWEO31GJG7JjrNWUI3JSzWjBaL1iuKPOkEKOt/CHeit2gvFCoSZJn6Pc3Xeg3x\n\t+fscDPI+/ZxkMcB7H/WD7ZhqFQQLQq0vij5MqdJaw0RD7LZSD6u0MevR29TsE6FO8d\n\tAFMSw86r/cwGw1HthDhlCQArMezPShN8M0ZwIk5ufVhyOilorWA6SDdekRvrXfRnBx\n\tHJ1Chs17iqGWgLOHKTVKYifOYOIwZVLb/VpSMrBQGvd8C/SfZboFh4iFXn32Jm04DL\n\tcxWQFTTliNNFw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1701966413;\n\tbh=mrDNiyXNdN0Bo5GwwmUqpEnfYFwK5Sg73vnKVFkDQ9w=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=ly9iwjZ+RaT0CIydyHdDXWBlqouB5c/RNx5QE9YHaxPo6Wz5m5AwUyXx5K3i9QJXX\n\tjsJQYiK52wPmwQLU1DFzrgdtogXiOyGVr8ZRixYuisM5nG9vDOZ1dbhge3NAXdgnsP\n\tpVBu1ecF/dHGE4fpwmDjLqu2yNiBrX8kCe8mAVvA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ly9iwjZ+\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20231206210524.20974-2-laurent.pinchart@ideasonboard.com>","References":"<20231206210524.20974-1-laurent.pinchart@ideasonboard.com>\n\t<20231206210524.20974-2-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 07 Dec 2023 16:27:31 +0000","Message-ID":"<170196645138.2829918.15756572480716947688@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 1/6] test: log: log_process: Log an\n\terror when failing due to incorrect message","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":28289,"web_url":"https://patchwork.libcamera.org/comment/28289/","msgid":"<2b7dd74c-c3f2-8312-2fac-d0be12e46014@ideasonboard.com>","date":"2023-12-08T07:11:03","subject":"Re: [libcamera-devel] [PATCH 1/6] test: log: log_process: Log an\n\terror when failing due to incorrect message","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 12/7/23 2:35 AM, Laurent Pinchart via libcamera-devel wrote:\n> One of the error paths in the test returns without logging a message,\n> which makes failures difficult to debug. Fix it by adding an error\n> message.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   test/log/log_process.cpp | 5 ++++-\n>   1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp\n> index 966b80cf3af7..17af7d74a1d5 100644\n> --- a/test/log/log_process.cpp\n> +++ b/test/log/log_process.cpp\n> @@ -115,8 +115,11 @@ protected:\n>   \t\tclose(fd);\n>   \n>   \t\tstring str(buf);\n> -\t\tif (str.find(message) == string::npos)\n> +\t\tif (str.find(message) == string::npos) {\n> +\t\t\tcerr << \"Received message is not correct (received \"\n> +\t\t\t     << str.length() << \" bytes)\" << endl;\n>   \t\t\treturn TestFail;\n> +\t\t}\n>   \n>   \t\treturn TestPass;\n>   \t}","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 AB5B8BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Dec 2023 07:11:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0018462B32;\n\tFri,  8 Dec 2023 08:11:10 +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 BD53F61D97\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Dec 2023 08:11:08 +0100 (CET)","from [192.168.1.105] (unknown [103.251.226.108])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 43E4156D;\n\tFri,  8 Dec 2023 08:10:26 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1702019471;\n\tbh=Dd0cS/v2agGcNlurWL8fc7qTSsHGTLWGco4RbA2Tk8s=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=n5jr4L1qlHqimO81WO5WtFOYzzyfab6d0YujQz/ZpZ0NNQ9DHOKt6IGjl+O5ccHIK\n\tqLzREReiCZ9Zxj7yofFvmuL5LCXuC1i2l90x6i68fp+uheqM6siq0t3I/ogSHECkGU\n\tXICRxq+l2cZ4x/g24d6m1Uh3qZ7Y8leWU4vOfabPANPbJ1X6iJh13Ec0FPgALE0bfB\n\tLE3qsGgBKb7JWKgNC3aThk1KvfJI5Ty9YZeH+Cyd3VM1OkR9RkJMB/BeYOb3V7UUSq\n\tDzIZKdQJfRCFbX6yQA/LiNfSaowWg2hwtMO2g/Gb676JrGNdscfDtQu18D6+XGVwyJ\n\tqjildwDLns8HA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1702019426;\n\tbh=Dd0cS/v2agGcNlurWL8fc7qTSsHGTLWGco4RbA2Tk8s=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=CdKEKnaA/wRGcp9OP/YuK4tTXDVzUyjDMojAlr0F6NcJqvfQAmw/1ViFK0oJGHtQO\n\t6dHqu3AxuI80pWOvpAzGMTPsF9wHbD7gnjhLbU5zeFofPe1vrc+8TJEgfaI0Slk+zK\n\ttLJKOQMChf8s522MI+85ojCDM3YFWqwXv7s6jc4g="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"CdKEKnaA\"; dkim-atps=neutral","Message-ID":"<2b7dd74c-c3f2-8312-2fac-d0be12e46014@ideasonboard.com>","Date":"Fri, 8 Dec 2023 12:41:03 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.10.0","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20231206210524.20974-1-laurent.pinchart@ideasonboard.com>\n\t<20231206210524.20974-2-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20231206210524.20974-2-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 1/6] test: log: log_process: Log an\n\terror when failing due to incorrect message","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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]