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>
This commit is contained in:
Kieran Bingham 2019-05-30 14:36:28 +01:00
parent 255e583857
commit 339e9b2d97
3 changed files with 9 additions and 3 deletions

View file

@ -42,7 +42,9 @@ protected:
int init() override
{
CameraTest::init();
int ret = CameraTest::init();
if (ret)
return ret;
config_ = camera_->generateConfiguration({ StreamRole::VideoRecording });
if (!config_ || config_->size() != 1) {