diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2019-05-30 14:36:28 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2019-06-10 12:29:40 +0100 |
commit | 339e9b2d976cc726ee4ec7de78ab5b7978b2eb8e (patch) | |
tree | cff6ddbf0f25e06b0925ee96f006e2f6c191fcfb /test/camera/configuration_set.cpp | |
parent | 255e58385784c7190194d4b8ba0523ad1e038ac4 (diff) |
test: camera: Fix initialisation
Three tests {capture,configuration_set,statemachine} override the
CameraTest::init() function, and call it as the first action.
However they were not checking the return value, and each of the tests
will segfault if the VIMC camera is not obtained.
Check the return value of the CameraTest base class initialisation and
return any errors to the test suite if initialisation fails.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/camera/configuration_set.cpp')
-rw-r--r-- | test/camera/configuration_set.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/camera/configuration_set.cpp b/test/camera/configuration_set.cpp index 9f10f795..f88da96c 100644 --- a/test/camera/configuration_set.cpp +++ b/test/camera/configuration_set.cpp @@ -18,7 +18,9 @@ class ConfigurationSet : public CameraTest protected: int init() override { - CameraTest::init(); + int ret = CameraTest::init(); + if (ret) + return ret; config_ = camera_->generateConfiguration({ StreamRole::VideoRecording }); if (!config_ || config_->size() != 1) { |