[{"id":1570,"web_url":"https://patchwork.libcamera.org/comment/1570/","msgid":"<20190511015226.GC12768@pendragon.ideasonboard.com>","date":"2019-05-11T01:52:26","subject":"Re: [libcamera-devel] [PATCH 2/5] test: v4l2_device: Implement\n\tfunctions inside class definition in cpp files","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Wed, May 08, 2019 at 06:58:11PM +0200, Niklas Söderlund wrote:\n> Implement the functions instead of just defining them in the class\n> description and implement them bellow for classes which are defined in\n> cpp source files.\n\nThe content of the patch is fine, but I find this sentence hard to\nparse. After rewording it,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> There is no functional change only restructuring of\n> existing code to align with the style of other tests.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  test/v4l2_device/formats.cpp | 58 +++++++++++++++++-------------------\n>  1 file changed, 28 insertions(+), 30 deletions(-)\n> \n> diff --git a/test/v4l2_device/formats.cpp b/test/v4l2_device/formats.cpp\n> index 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);","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 F385860E4D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 11 May 2019 03:52:42 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5B76F2DF;\n\tSat, 11 May 2019 03:52:42 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1557539562;\n\tbh=NchTjIRCUKh3f7pGVSQMCb41AGP6/W7liqYKyw7BjR0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=nzazN21SMsu7z0ces/D9FqHJIe4lghsJCjFI9lN3bDIPBTXnh9JzPQdLY3hAzs8Sh\n\t+4rlVL2TuBpb0otcgGgb9KdZrGgzpIqsvyNzaMtzVUAv617tVc/VOrLwEVP6f9bHG9\n\tGq0CMCsXJw+en/SizZbDQt/IFos1RPY9VG04ZzKw=","Date":"Sat, 11 May 2019 04:52:26 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190511015226.GC12768@pendragon.ideasonboard.com>","References":"<20190508165814.26201-1-niklas.soderlund@ragnatech.se>\n\t<20190508165814.26201-3-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190508165814.26201-3-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 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 01:52:43 -0000"}}]