!1087 camera&&sensor用例适配

Merge pull request !1087 from dongshaomin/master
This commit is contained in:
openharmony_ci 2024-04-23 09:45:43 +00:00 committed by Gitee
commit 60a38134e9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 14 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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<int>(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<int>(entry.data.u8[0]) << std::endl;
}
/**
* @tc.name: Quick Thumbnail

View File

@ -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;
}
}

View File

@ -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});
}

View File

@ -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()