diff --git a/hdf/camera/cameraMg/v1_0/src/common.cpp b/hdf/camera/cameraMg/v1_0/src/common.cpp index 0b3ab835..ce8d2c2f 100644 --- a/hdf/camera/cameraMg/v1_0/src/common.cpp +++ b/hdf/camera/cameraMg/v1_0/src/common.cpp @@ -84,6 +84,7 @@ void Test::Init() if (cameraIds.size() == 0) { CAMERA_LOGE("camera device list empty"); GTEST_SKIP() << "No Camera Available" << std::endl; + return; } } diff --git a/hdf/camera/cameraMg/v1_1/src/camera_hdi_uttest_v1_1.cpp b/hdf/camera/cameraMg/v1_1/src/camera_hdi_uttest_v1_1.cpp index 50522221..36cf5368 100644 --- a/hdf/camera/cameraMg/v1_1/src/camera_hdi_uttest_v1_1.cpp +++ b/hdf/camera/cameraMg/v1_1/src/camera_hdi_uttest_v1_1.cpp @@ -241,8 +241,12 @@ HWTEST_F(CameraHdiTestV1_1, SUB_Driver_Camera_QuickThumbnail_0100, TestSize.Leve EXPECT_NE(data, nullptr); camera_metadata_item_t entry; int ret = FindCameraMetadataItem(data,OHOS_ABILITY_STREAM_QUICK_THUMBNAIL_AVAILABLE, &entry); - EXPECT_EQ(ret, CAM_META_SUCCESS); - std::cout << "OHOS_ABILITY_STREAM_QUICK_THUMBNAIL_AVAILABLE value is " << static_cast(entry.data.i32[0]) << std::endl; + if (ret != CAM_META_SUCCESS) { + GTEST_SKIP() << "This function is not supported " << std::endl; + return; + } + std::cout << "OHOS_ABILITY_STREAM_QUICK_THUMBNAIL_AVAILABLE value is" + << static_cast(entry.data.u8[0]) << std::endl; } /** * @tc.name: Quick Thumbnail diff --git a/hdf/camera/cameraMg/v1_1/src/hdi_common_v1_1.cpp b/hdf/camera/cameraMg/v1_1/src/hdi_common_v1_1.cpp index 361617ee..4fba702e 100644 --- a/hdf/camera/cameraMg/v1_1/src/hdi_common_v1_1.cpp +++ b/hdf/camera/cameraMg/v1_1/src/hdi_common_v1_1.cpp @@ -96,6 +96,7 @@ void Test::Init() if (cameraIds.size() == 0) { CAMERA_LOGE("camera device list empty"); GTEST_SKIP() << "No Camera Available" << std::endl; + return; } } diff --git a/hdf/camera/cameraMg_additional/v1_0/src/hdi_stream_uttest.cpp b/hdf/camera/cameraMg_additional/v1_0/src/hdi_stream_uttest.cpp index a553b441..b7bd3f44 100644 --- a/hdf/camera/cameraMg_additional/v1_0/src/hdi_stream_uttest.cpp +++ b/hdf/camera/cameraMg_additional/v1_0/src/hdi_stream_uttest.cpp @@ -97,6 +97,7 @@ HWTEST_F(HdiStreamUtTestAdditional, testCancelCapture004, Function | MediumTest cameraTest->StartCapture(cameraTest->streamIdPreview, cameraTest->captureIdPreview, true, true); cameraTest->rc = cameraTest->streamOperator->CancelCapture(cameraTest->captureIdPreview); EXPECT_EQ(cameraTest->rc, HDI::Camera::V1_0::NO_ERROR); + sleep(1); } cameraTest->rc = cameraTest->streamOperator->ReleaseStreams({cameraTest->streamIdPreview}); } diff --git a/hdf/sensor/hdiService/hdf_sensor_hdiService_test.cpp b/hdf/sensor/hdiService/hdf_sensor_hdiService_test.cpp index ba28b6f6..66d12614 100644 --- a/hdf/sensor/hdiService/hdf_sensor_hdiService_test.cpp +++ b/hdf/sensor/hdiService/hdf_sensor_hdiService_test.cpp @@ -116,6 +116,11 @@ void HdfSensorHdiTest::TearDownTestCase() void HdfSensorHdiTest::SetUp() { + if (g_sensorInterface == nullptr) { + printf("Sensor list is empty"); + GTEST_SKIP() << "Device not exist" << std::endl; + return; + } } void HdfSensorHdiTest::TearDown()