From a2a0e46576fb142147abfb94718831842fc39118 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 22 Nov 2019 14:59:31 +0100 Subject: test: controls: control_list: Add status check Since commit fac471e812a9 ("test: Extract CameraTest class out of camera tests to libtest") the control_list is a subclass of CameraTest, and the status returned by the base class init() operation should be inspected to avoid accessing uninitialized fields during the run() operation execution. If the VIMC test module is not loaded, executing the test results in a segfault. Fix this by adding the init() operation where to status_ flag is checked for errors. Fixes: fac471e812a9 ("test: Extract CameraTest class out of camera tests to libtest") Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- test/controls/control_list.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/controls') diff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp index 4d212abd..5374c6f9 100644 --- a/test/controls/control_list.cpp +++ b/test/controls/control_list.cpp @@ -29,7 +29,12 @@ public: } protected: - int run() + int init() override + { + return status_; + } + + int run() override { CameraControlValidator validator(camera_.get()); ControlList list(controls::controls, &validator); -- cgit v1.2.1