[{"id":35664,"web_url":"https://patchwork.libcamera.org/comment/35664/","msgid":"<175672672726.50296.16702309738039753@ping.linuxembedded.co.uk>","date":"2025-09-01T11:38:47","subject":"Re: [PATCH] test: utils: Add endlines","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Paul Elder (2025-08-25 12:44:09)\n> Most of the error messages from the utils test had no endlines. Add them\n> so that the output is nicer.\n\n'and standardise on using endl; as we are already using the std\nnamespace.'\n\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  test/utils.cpp | 18 +++++++++---------\n>  1 file changed, 9 insertions(+), 9 deletions(-)\n> \n> diff --git a/test/utils.cpp b/test/utils.cpp\n> index 195fddc97d97..ae5b01746722 100644\n> --- a/test/utils.cpp\n> +++ b/test/utils.cpp\n> @@ -85,7 +85,7 @@ protected:\n>                         if (index != i || value != i + 1) {\n>                                 cerr << \"utils::enumerate(<vector>) test failed: i=\" << i\n>                                      << \", index=\" << index << \", value=\" << value\n> -                                    << std::endl;\n> +                                    << endl;\n>                                 return TestFail;\n>                         }\n>  \n> @@ -106,7 +106,7 @@ protected:\n>                         if (index != i || value != i) {\n>                                 cerr << \"utils::enumerate(<span>) test failed: i=\" << i\n>                                      << \", index=\" << index << \", value=\" << value\n> -                                    << std::endl;\n> +                                    << endl;\n>                                 return TestFail;\n>                         }\n>  \n> @@ -120,7 +120,7 @@ protected:\n>                         if (index != i || value != i * 2) {\n>                                 cerr << \"utils::enumerate(<array>) test failed: i=\" << i\n>                                      << \", index=\" << index << \", value=\" << value\n> -                                    << std::endl;\n> +                                    << endl;\n>                                 return TestFail;\n>                         }\n>  \n> @@ -138,32 +138,32 @@ protected:\n>  \n>                 exposure = 25ms + 25ms;\n>                 if (exposure.get<std::micro>() != 50000.0) {\n> -                       cerr << \"utils::Duration failed to return microsecond count\";\n> +                       cerr << \"utils::Duration failed to return microsecond count\" << endl;\n>                         return TestFail;\n>                 }\n>  \n>                 exposure = 1.0s / 4;\n>                 if (exposure != 250ms) {\n> -                       cerr << \"utils::Duration failed scalar divide test\";\n> +                       cerr << \"utils::Duration failed scalar divide test\" << endl;\n>                         return TestFail;\n>                 }\n>  \n>                 exposure = 5000.5us;\n>                 if (!exposure) {\n> -                       cerr << \"utils::Duration failed boolean test\";\n> +                       cerr << \"utils::Duration failed boolean test\" << endl;\n>                         return TestFail;\n>                 }\n>  \n>                 os << exposure;\n>                 if (os.str() != \"5000.50us\") {\n> -                       cerr << \"utils::Duration operator << failed\";\n> +                       cerr << \"utils::Duration operator << failed\" << endl;\n>                         return TestFail;\n>                 }\n>  \n>                 exposure = 100ms;\n>                 ratio = exposure / 25ms;\n>                 if (ratio != 4.0) {\n> -                       cerr << \"utils::Duration failed ratio test\";\n> +                       cerr << \"utils::Duration failed ratio test\" << endl;\n>                         return TestFail;\n>                 }\n>  \n> @@ -219,7 +219,7 @@ protected:\n>                 std::string s = os.str();\n>                 if (s != ref) {\n>                         cerr << \"utils::hex() test failed, expected '\" << ref\n> -                            << \"', got '\" << s << \"'\";\n> +                            << \"', got '\" << s << \"'\" << endl;\n>                         return TestFail;\n>                 }\n>  \n> -- \n> 2.47.2\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 50449BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Sep 2025 11:38:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5F6A069324;\n\tMon,  1 Sep 2025 13:38:52 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9EA2669323\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Sep 2025 13:38:50 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 58CDDE45;\n\tMon,  1 Sep 2025 13:37:43 +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=\"JfG5uPmN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1756726663;\n\tbh=bqcBY/XDfagEdEkIqk114IbAwNofGdv6hSPn04CrViA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=JfG5uPmNNU6IoHh4BcBcAzCKrdLt3J1rziOrxOGX5qs5IR1+2+wlS9sfU7tkCUISb\n\th7iW9Fo//SdRjB+Wc9vbSdGXnCwweA6PjTZEMxN50iERQc2+v3t5Ym4jafZneYDpfG\n\t81e0YJLEG9nprgVyCpF13hEkX0R5yncMz2hvUud8=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250825114409.569050-1-paul.elder@ideasonboard.com>","References":"<20250825114409.569050-1-paul.elder@ideasonboard.com>","Subject":"Re: [PATCH] test: utils: Add endlines","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Paul Elder <paul.elder@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 01 Sep 2025 12:38:47 +0100","Message-ID":"<175672672726.50296.16702309738039753@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}},{"id":35682,"web_url":"https://patchwork.libcamera.org/comment/35682/","msgid":"<20250901152149.GG1705@pendragon.ideasonboard.com>","date":"2025-09-01T15:21:49","subject":"Re: [PATCH] test: utils: Add endlines","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Sep 01, 2025 at 12:38:47PM +0100, Kieran Bingham wrote:\n> Quoting Paul Elder (2025-08-25 12:44:09)\n> > Most of the error messages from the utils test had no endlines. Add them\n> > so that the output is nicer.\n> \n> 'and standardise on using endl; as we are already using the std\n> namespace.'\n\nI'd have skipped that, as I think we shouldn't \"use std\". It doesn't\nmatter too much. At some point we should likely replace these messages\nwith assertion macros and exceptions (gtest was proposed too, it's an\noption even if I don't like it much).\n\n> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > ---\n> >  test/utils.cpp | 18 +++++++++---------\n> >  1 file changed, 9 insertions(+), 9 deletions(-)\n> > \n> > diff --git a/test/utils.cpp b/test/utils.cpp\n> > index 195fddc97d97..ae5b01746722 100644\n> > --- a/test/utils.cpp\n> > +++ b/test/utils.cpp\n> > @@ -85,7 +85,7 @@ protected:\n> >                         if (index != i || value != i + 1) {\n> >                                 cerr << \"utils::enumerate(<vector>) test failed: i=\" << i\n> >                                      << \", index=\" << index << \", value=\" << value\n> > -                                    << std::endl;\n> > +                                    << endl;\n> >                                 return TestFail;\n> >                         }\n> >  \n> > @@ -106,7 +106,7 @@ protected:\n> >                         if (index != i || value != i) {\n> >                                 cerr << \"utils::enumerate(<span>) test failed: i=\" << i\n> >                                      << \", index=\" << index << \", value=\" << value\n> > -                                    << std::endl;\n> > +                                    << endl;\n> >                                 return TestFail;\n> >                         }\n> >  \n> > @@ -120,7 +120,7 @@ protected:\n> >                         if (index != i || value != i * 2) {\n> >                                 cerr << \"utils::enumerate(<array>) test failed: i=\" << i\n> >                                      << \", index=\" << index << \", value=\" << value\n> > -                                    << std::endl;\n> > +                                    << endl;\n> >                                 return TestFail;\n> >                         }\n> >  \n> > @@ -138,32 +138,32 @@ protected:\n> >  \n> >                 exposure = 25ms + 25ms;\n> >                 if (exposure.get<std::micro>() != 50000.0) {\n> > -                       cerr << \"utils::Duration failed to return microsecond count\";\n> > +                       cerr << \"utils::Duration failed to return microsecond count\" << endl;\n\nI'd wrap this line and possibly the next one.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >                         return TestFail;\n> >                 }\n> >  \n> >                 exposure = 1.0s / 4;\n> >                 if (exposure != 250ms) {\n> > -                       cerr << \"utils::Duration failed scalar divide test\";\n> > +                       cerr << \"utils::Duration failed scalar divide test\" << endl;\n> >                         return TestFail;\n> >                 }\n> >  \n> >                 exposure = 5000.5us;\n> >                 if (!exposure) {\n> > -                       cerr << \"utils::Duration failed boolean test\";\n> > +                       cerr << \"utils::Duration failed boolean test\" << endl;\n> >                         return TestFail;\n> >                 }\n> >  \n> >                 os << exposure;\n> >                 if (os.str() != \"5000.50us\") {\n> > -                       cerr << \"utils::Duration operator << failed\";\n> > +                       cerr << \"utils::Duration operator << failed\" << endl;\n> >                         return TestFail;\n> >                 }\n> >  \n> >                 exposure = 100ms;\n> >                 ratio = exposure / 25ms;\n> >                 if (ratio != 4.0) {\n> > -                       cerr << \"utils::Duration failed ratio test\";\n> > +                       cerr << \"utils::Duration failed ratio test\" << endl;\n> >                         return TestFail;\n> >                 }\n> >  \n> > @@ -219,7 +219,7 @@ protected:\n> >                 std::string s = os.str();\n> >                 if (s != ref) {\n> >                         cerr << \"utils::hex() test failed, expected '\" << ref\n> > -                            << \"', got '\" << s << \"'\";\n> > +                            << \"', got '\" << s << \"'\" << endl;\n> >                         return TestFail;\n> >                 }\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 39B5DBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Sep 2025 15:22:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 372A369332;\n\tMon,  1 Sep 2025 17:22:11 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3841569323\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Sep 2025 17:22:10 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(230.215-178-91.adsl-dyn.isp.belgacom.be [91.178.215.230])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 6CFCEEAE;\n\tMon,  1 Sep 2025 17:21:02 +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=\"FyiyGEFC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1756740062;\n\tbh=uGl9Xr2wTiwqeHGO75lCfid1O7UzKZhqChJAsG02m+o=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=FyiyGEFCWOp+GgnWpnZMVgXu7fJ77g/ca5jYBTvR+/aAlWU2c4PBseliJca7H0oVv\n\tlNRqaGPiHatVF7ni/KoWGAc2T96+zks36wbzl0UF4FyXmDxrcHx2paRwjChdiacDM7\n\tIFdawTmtF9YbGnQAIEqYxDBTfBN/aCyr4Nq0ZCr8=","Date":"Mon, 1 Sep 2025 17:21:49 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Paul Elder <paul.elder@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] test: utils: Add endlines","Message-ID":"<20250901152149.GG1705@pendragon.ideasonboard.com>","References":"<20250825114409.569050-1-paul.elder@ideasonboard.com>\n\t<175672672726.50296.16702309738039753@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<175672672726.50296.16702309738039753@ping.linuxembedded.co.uk>","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>"}}]