{"id":3994,"url":"https://patchwork.libcamera.org/api/patches/3994/?format=json","web_url":"https://patchwork.libcamera.org/patch/3994/","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":"<20200608152202.5876-1-email@uajain.com>","date":"2020-06-08T15:22:10","name":"[libcamera-devel] test: v4l2_subdevice: list_formats: Port to use utils::hex() output helper","commit_ref":"313d65ca2545534bba369331068bb57e65ac9318","pull_url":null,"state":"accepted","archived":false,"hash":"4d2d03ca13ff499ecdfcba4b428ad2c9c7d2d1a8","submitter":{"id":1,"url":"https://patchwork.libcamera.org/api/people/1/?format=json","name":"Umang Jain","email":"email@uajain.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3994/mbox/","series":[{"id":978,"url":"https://patchwork.libcamera.org/api/series/978/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=978","date":"2020-06-08T15:22:10","name":"[libcamera-devel] test: v4l2_subdevice: list_formats: Port to use utils::hex() output helper","version":1,"mbox":"https://patchwork.libcamera.org/series/978/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3994/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3994/checks/","tags":{},"headers":{"Return-Path":"<bounces+15657259-5c31-libcamera-devel=lists.libcamera.org@em7280.uajain.com>","Received":["from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 38FFE603C5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Jun 2020 17:22:12 +0200 (CEST)","by filter0072p3las1.sendgrid.net with SMTP id\n\tfilter0072p3las1-16738-5EDE57A1-192\n\t2020-06-08 15:22:10.096468264 +0000 UTC m=+489557.898165555","from mail.uajain.com (unknown)\n\tby ismtpd0006p1hnd1.sendgrid.net (SG) with ESMTP\n\tid -2T_qH9rQcWPMFslfW7rKA Mon, 08 Jun 2020 15:22:09.642 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=uajain.com\n\theader.i=@uajain.com header.b=\"tBvFcBuj\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com;\n\th=from:subject:mime-version:to:cc:content-transfer-encoding:\n\tcontent-type;\n\ts=s1; bh=VwQ6/Q2g383+ErzqF5PW50gXSkTev9Dem7OuFL9KUlc=;\n\tb=tBvFcBujvZr1RvzoE04bbGkeOl2YwMJsqVsx1Zj8fouc3MUpiUitCYQP91/BOi0vCdmN\n\toifuDOvBizLubO/5W29Vud67Iy/8K1dFKAsJeAV1febvs6aw5J3Q/MhftZ/nznSkdNa84i\n\tNMsZ0+1Nj/Ai+Kc+n9B55r2D9TiN2KmZM=","From":"Umang Jain <email@uajain.com>","Date":"Mon, 08 Jun 2020 15:22:10 +0000 (UTC)","Message-Id":"<20200608152202.5876-1-email@uajain.com>","Mime-Version":"1.0","X-SG-EID":"1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcIQ89AvAiYjJmgYkN1WcnPb0WM4+w+LgMup123cR1wvxSuR2JaLxXoPW4uMd+FnmH4e1ETkJsQeSYKXHIVLC5cLBWm8fc15l2LBKP7zPp+mOReKELopOjSjoEixlqGQNJDDz5xtcGNrd2do0wV40YdlMucSl1lSxjuqupGXFhNOIX2TsOC2kwGzLtO0IST+qg","To":"libcamera-devel@lists.libcamera.org, laurent.pinchart@ideasonboard.com, \n\tkieran.bingham@ideasonboard.com","Content-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=us-ascii","Subject":"[libcamera-devel] [PATCH] test: v4l2_subdevice: list_formats: Port\n\tto use utils::hex() output helper","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>","X-List-Received-Date":"Mon, 08 Jun 2020 15:22:12 -0000"},"content":"The hex stream output helper was introduced in f391048a7b98 (\"libcamera: utils:\nAdd hex stream output helper\"). It simplifies writing hexadecimal values to an\nostream which can be used in this test too. As the helper doesn't modify the\nstream configuration (refer to utils::hex() documentation), this eliminates the\nneed of restoring the stream's format state as pointed out by the coverity scan.\n\nFixes: f391048a7b98 (\"libcamera: utils: Add hex stream output helper\")\nReported-by: Coverity CID=279058\nSigned-off-by: Umang Jain <email@uajain.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/v4l2_subdevice/list_formats.cpp | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)","diff":"diff --git a/test/v4l2_subdevice/list_formats.cpp b/test/v4l2_subdevice/list_formats.cpp\nindex 25503c3..a55af11 100644\n--- a/test/v4l2_subdevice/list_formats.cpp\n+++ b/test/v4l2_subdevice/list_formats.cpp\n@@ -5,12 +5,12 @@\n  * libcamera V4L2 Subdevice format handling test\n  */\n \n-#include <iomanip>\n #include <iostream>\n #include <vector>\n \n #include <libcamera/geometry.h>\n \n+#include \"libcamera/internal/utils.h\"\n #include \"libcamera/internal/v4l2_subdevice.h\"\n \n #include \"v4l2_subdevice_test.h\"\n@@ -36,8 +36,7 @@ void ListFormatsTest::printFormats(unsigned int pad,\n {\n \tcout << \"Enumerate formats on pad \" << pad << endl;\n \tfor (const SizeRange &size : sizes) {\n-\t\tcout << \"\tmbus code: 0x\" << setfill('0') << setw(4)\n-\t\t     << hex << code << endl;\n+\t\tcout << \"\tmbus code: \" << utils::hex(code, 4) << endl;\n \t\tcout << \"\tmin width: \" << dec << size.min.width << endl;\n \t\tcout << \"\tmin height: \" << dec << size.min.height << endl;\n \t\tcout << \"\tmax width: \" << dec << size.max.width << endl;\n","prefixes":["libcamera-devel"]}