{"id":1199,"url":"https://patchwork.libcamera.org/api/1.1/patches/1199/?format=json","web_url":"https://patchwork.libcamera.org/patch/1199/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20190511111115.16727-3-niklas.soderlund@ragnatech.se>","date":"2019-05-11T11:11:12","name":"[libcamera-devel,v2,2/5] test: v4l2_device: Implement functions inside class definition in cpp files","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"e0bb4e23f817b0ad6749dd36a37cc73c66b9f37a","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1199/mbox/","series":[{"id":304,"url":"https://patchwork.libcamera.org/api/1.1/series/304/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=304","date":"2019-05-11T11:11:10","name":"test: v4l2_device: Cleanups and a small speed increase","version":2,"mbox":"https://patchwork.libcamera.org/series/304/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1199/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1199/checks/","tags":{},"headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7023860E4F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 May 2019 13:11:41 +0200 (CEST)","from localhost.localdomain (unknown [185.224.57.161])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 8688bfee-73dd-11e9-81fd-0050569116f7;\n\tSat, 11 May 2019 13:11:31 +0200 (CEST)"],"X-Halon-ID":"8688bfee-73dd-11e9-81fd-0050569116f7","Authorized-sender":"niklas@soderlund.pp.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 11 May 2019 13:11:12 +0200","Message-Id":"<20190511111115.16727-3-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190511111115.16727-1-niklas.soderlund@ragnatech.se>","References":"<20190511111115.16727-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 2/5] test: v4l2_device: Implement\n\tfunctions inside class definition in cpp files","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Sat, 11 May 2019 11:11:41 -0000"},"content":"Align the style of the formats test with the other v4l2_device tests by\nimpending the functions in the class definition instead of first\ndeclaring the class and then implement the functions. There is no\nfunctional change only restructuring of existing code to align with the\nstyle of other tests.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/v4l2_device/formats.cpp | 58 +++++++++++++++++-------------------\n 1 file changed, 28 insertions(+), 30 deletions(-)","diff":"diff --git a/test/v4l2_device/formats.cpp b/test/v4l2_device/formats.cpp\nindex 007e7e9487b57772..72676c9d334a69b0 100644\n--- a/test/v4l2_device/formats.cpp\n+++ b/test/v4l2_device/formats.cpp\n@@ -18,36 +18,34 @@ using namespace libcamera;\n class Format : public V4L2DeviceTest\n {\n protected:\n-\tint run() override;\n+\tint run()\n+\t{\n+\t\tV4L2DeviceFormat format = {};\n+\n+\t\tint ret = capture_->getFormat(&format);\n+\t\tif (ret) {\n+\t\t\tcerr << \"Failed to get format\" << endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n+\t\tformat.size = { UINT_MAX, UINT_MAX };\n+\t\tret = capture_->setFormat(&format);\n+\t\tif (ret) {\n+\t\t\tcerr << \"Failed to set format: image resolution is invalid: \"\n+\t\t\t     << \"(UINT_MAX x UINT_MAX) but setFormat() should not fail.\"\n+\t\t\t     << endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n+\t\tif (format.size.width == UINT_MAX ||\n+\t\t    format.size.height == UINT_MAX) {\n+\t\t\tcerr << \"Failed to update image format = (UINT_MAX x UINT_MAX)\"\n+\t\t\t     << endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n+\t\treturn TestPass;\n+\t}\n };\n \n-int Format::run()\n-{\n-\tV4L2DeviceFormat format = {};\n-\n-\tint ret = capture_->getFormat(&format);\n-\tif (ret) {\n-\t\tcerr << \"Failed to get format\" << endl;\n-\t\treturn TestFail;\n-\t}\n-\n-\tformat.size = { UINT_MAX, UINT_MAX };\n-\tret = capture_->setFormat(&format);\n-\tif (ret) {\n-\t\tcerr << \"Failed to set format: image resolution is invalid: \"\n-\t\t     << \"(UINT_MAX x UINT_MAX) but setFormat() should not fail.\"\n-\t\t     << endl;\n-\t\treturn TestFail;\n-\t}\n-\n-\tif (format.size.width == UINT_MAX ||\n-\t    format.size.height == UINT_MAX) {\n-\t\tcerr << \"Failed to update image format = (UINT_MAX x UINT_MAX)\"\n-\t\t     << endl;\n-\t\treturn TestFail;\n-\t}\n-\n-\treturn TestPass;\n-}\n-\n TEST_REGISTER(Format);\n","prefixes":["libcamera-devel","v2","2/5"]}