diff options
author | Avichal Rakesh <arakesh@google.com> | 2022-03-09 01:00:34 +0000 |
---|---|---|
committer | Avichal Rakesh <arakesh@google.com> | 2022-03-09 21:55:24 +0000 |
commit | fbcf7ea5143a51059fadbf74e56508c6dd095a67 (patch) | |
tree | d782f9f102e91cba0ae98e18d17a1edd2a5277ed /camera/provider/aidl/vts/camera_aidl_test.cpp | |
parent | 2bb879d8bb843a33171c32e058587c41355f27ac (diff) |
Camera: Misc VTS test fixes
This CL fixes two tests:
* `systemCameraTest`: Fix incorrect vector initialization. The test was
accidentally using the size constructor instead of initialization list
constructor.
* `processMultiCaptureRequestPreview`: Allow unsupported stream configs.
The test assumed that all stream combinations from physical cameras
that back a LogicalMultiCamera were supported. This led to false
test failures. This CL allows the test to exit early if the HAL
reports that a stream combination is not supported.
Bug: 222648486
Test: `test VtsAidlHalCameraProvider_TargetTest` pass on failing devices
Change-Id: I009cc2f4b8b94a26b813883cdc1403ae0eb5c477
Diffstat (limited to 'camera/provider/aidl/vts/camera_aidl_test.cpp')
-rw-r--r-- | camera/provider/aidl/vts/camera_aidl_test.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index 858dfd5fdc..ee0c6914d4 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -1564,6 +1564,7 @@ void CameraAidlTest::openEmptyDeviceSession(const std::string& name, ASSERT_NE(*session, nullptr); ret = (*device)->getCameraCharacteristics(staticMeta); + ASSERT_TRUE(ret.isOk()); } void CameraAidlTest::openEmptyInjectionSession(const std::string& name, @@ -2474,7 +2475,7 @@ void CameraAidlTest::configurePreviewStreams( std::shared_ptr<ICameraDeviceSession>* session, Stream* previewStream, std::vector<HalStream>* halStreams, bool* supportsPartialResults, int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr<DeviceCb>* cb, - int32_t streamConfigCounter) { + int32_t streamConfigCounter, bool allowUnsupport) { ASSERT_NE(nullptr, session); ASSERT_NE(nullptr, halStreams); ASSERT_NE(nullptr, previewStream); @@ -2561,6 +2562,14 @@ void CameraAidlTest::configurePreviewStreams( bool supported = false; ret = device->isStreamCombinationSupported(config, &supported); ASSERT_TRUE(ret.isOk()); + if (allowUnsupport && !supported) { + // stream combination not supported. return null session + ret = (*session)->close(); + ASSERT_TRUE(ret.isOk()); + *session = nullptr; + return; + } + ASSERT_TRUE(supported) << "Stream combination must be supported."; config.streamConfigCounter = streamConfigCounter; std::vector<HalStream> halConfigs; |