[{"id":3133,"web_url":"https://patchwork.libcamera.org/comment/3133/","msgid":"<20191123004720.GA4704@pendragon.ideasonboard.com>","date":"2019-11-23T00:47:20","subject":"Re: [libcamera-devel] [PATCH] test: controls: control_list: Add\n\tstatus check","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Fri, Nov 22, 2019 at 03:03:46PM +0100, Jacopo Mondi wrote:\n> Since commit:\n> fac471e812a9 (\"test: Extract CameraTest class out of camera tests to libtest\")\n> the control_list is a subclass of CameraTest, and the status returned by\n> the base class init() operation should be inspected to avoid accessing\n> uninitialized fields during the run() operation execution.\n\nNitpicking, you can remove the colon and reflow text here:\n\nSince commit fac471e812a9 (\"test: Extract CameraTest class out of\ncamera tests to libtest\") the control_list is a subclass of CameraTest,\nand the status returned by the base class init() operation should be\ninspected to avoid accessing uninitialized fields during the run()\noperation execution.\n\nOnly the Fixes: line should avoid breaking the commit message text.\n\n> If the VIMC test module is not loaded, executing the test results in a\n> segfault. Fix this by adding the init() operation where to status_ flag\n> is checked for errors.\n> \n> Fixes: fac471e812a9 (\"test: Extract CameraTest class out of camera tests to libtest\")\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nGood catch, thanks.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  test/controls/control_list.cpp | 7 ++++++-\n>  1 file changed, 6 insertions(+), 1 deletion(-)\n> \n> diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp\n> index 4d212abd09e6..5374c6f99f80 100644\n> --- a/test/controls/control_list.cpp\n> +++ b/test/controls/control_list.cpp\n> @@ -29,7 +29,12 @@ public:\n>  \t}\n>  \n>  protected:\n> -\tint run()\n> +\tint init() override\n> +\t{\n> +\t\treturn status_;\n> +\t}\n> +\n> +\tint run() override\n>  \t{\n>  \t\tCameraControlValidator validator(camera_.get());\n>  \t\tControlList list(controls::controls, &validator);","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 70D0360C22\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 23 Nov 2019 01:47:31 +0100 (CET)","from pendragon.ideasonboard.com (unknown [122.147.213.64])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DB6CF440;\n\tSat, 23 Nov 2019 01:47:29 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1574470051;\n\tbh=HOPGaIcdIor8DBV8Ppdd1QFdxvNFqRol8HsT+xYjsBo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=qL37xunZFe2jH01FNegbEAS+jvvRf48+sEW+XAFlJLeCV4kAVdX1vxyg8t+QzkBcp\n\tD22hPK/4hwbtbf2kBychnqj51modGZ566ci8F/9X3BC2dxxDExbvT6p0+tBvRTp0LI\n\t1XcEWllIGhNobxc6+UneWEelLWsQGyxr/7dafxec=","Date":"Sat, 23 Nov 2019 02:47:20 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191123004720.GA4704@pendragon.ideasonboard.com>","References":"<20191122140346.11040-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20191122140346.11040-1-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] test: controls: control_list: Add\n\tstatus check","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":"Sat, 23 Nov 2019 00:47:31 -0000"}}]