!354 code 枚举用例覆盖

Merge pull request !354 from lixin475/li_2022_1029_1756
This commit is contained in:
openharmony_ci 2022-10-29 11:50:27 +00:00 committed by Gitee
commit d3ef09e44c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 118 additions and 0 deletions

View File

@ -593,6 +593,110 @@ HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0240, Function |
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateSuccessTest_002
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0241
* @tc.desc When state is set to OMX_StateInvalid, the GetState interface is invoked to obtain the component status
*/
HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0241, Function | MediumTest | Level3)
{
ASSERT_TRUE(g_component != nullptr);
OMX_STATETYPE state;
int32_t ret = g_component->GetState(g_component, &state);
ASSERT_NE(state, OMX_StateInvalid);
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateSuccessTest_003
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0242
* @tc.desc When state is set to OMX_StateExecuting, the GetState interface is invoked to obtain the component status
*/
HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0242, Function | MediumTest | Level3)
{
ASSERT_TRUE(g_component != nullptr);
OMX_STATETYPE state;
int32_t ret = g_component->GetState(g_component, &state);
ASSERT_NE(state, OMX_StateExecuting);
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateSuccessTest_004
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0243
* @tc.desc When state is set to OMX_StateIdle, the GetState interface is invoked to obtain the component status
*/
HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0243, Function | MediumTest | Level3)
{
ASSERT_TRUE(g_component != nullptr);
OMX_STATETYPE state;
int32_t ret = g_component->GetState(g_component, &state);
ASSERT_NE(state, OMX_StateIdle);
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateSuccessTest_005
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0244
* @tc.desc When state is set to OMX_StatePause, the GetState interface is invoked to obtain the component status
*/
HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0244, Function | MediumTest | Level3)
{
ASSERT_TRUE(g_component != nullptr);
OMX_STATETYPE state;
int32_t ret = g_component->GetState(g_component, &state);
ASSERT_NE(state, OMX_StatePause);
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateSuccessTest_006
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0245
* @tc.desc When state is set to OMX_StateWaitForResources, the GetState interface is invoked to obtain the component status
*/
HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0245, Function | MediumTest | Level3)
{
ASSERT_TRUE(g_component != nullptr);
OMX_STATETYPE state;
int32_t ret = g_component->GetState(g_component, &state);
ASSERT_NE(state, OMX_StateWaitForResources);
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateSuccessTest_007
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0246
* @tc.desc When state is set to OMX_StateKhronosExtensions, the GetState interface is invoked to obtain the component status
*/
HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0246, Function | MediumTest | Level3)
{
ASSERT_TRUE(g_component != nullptr);
OMX_STATETYPE state;
int32_t ret = g_component->GetState(g_component, &state);
ASSERT_NE(state, OMX_StateKhronosExtensions);
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateSuccessTest_008
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0247
* @tc.desc When state is set to OMX_StateVendorStartUnused, the GetState interface is invoked to obtain the component status
*/
HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0247, Function | MediumTest | Level3)
{
ASSERT_TRUE(g_component != nullptr);
OMX_STATETYPE state;
int32_t ret = g_component->GetState(g_component, &state);
ASSERT_NE(state, OMX_StateVendorStartUnused);
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateSuccessTest_009
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0248
* @tc.desc When state is set to OMX_StateMax, the GetState interface is invoked to obtain the component status
*/
HWTEST_F(CodecHdiAdapterTest, SUB_DriverSystem_CodecHdi_adapter_0248, Function | MediumTest | Level3)
{
ASSERT_TRUE(g_component != nullptr);
OMX_STATETYPE state;
int32_t ret = g_component->GetState(g_component, &state);
ASSERT_NE(state, OMX_StateMax);
ASSERT_EQ(ret, HDF_SUCCESS);
}
/**
* @tc.name HdfCodecHdiGetStateStateNullptrTest_002
* @tc.number SUB_DriverSystem_CodecHdi_adapter_0250
* @tc.desc When state is set to nullptr, the GetState interface is invoked to obtain the component status

View File

@ -197,6 +197,20 @@ HWTEST_F(CodecProxyTest, HdfCodecHdiV1CreateCodecByTypeTest_003, TestSize.Level1
ASSERT_EQ(errorCode, HDF_ERR_NOT_SUPPORT);
}
HWTEST_F(CodecProxyTest, HdfCodecHdiV1CreateCodecByTypeTest_004 TestSize.Level1)
{
AvCodecMime mime = MEDIA_MIMETYPE_VIDEO_AVC;
int32_t errorCode = g_codecObj->CodecCreateByType(g_codecObj, AUDIO_ENCODER, mime, &g_handle);
ASSERT_EQ(errorCode, HDF_ERR_NOT_SUPPORT);
}
HWTEST_F(CodecProxyTest, HdfCodecHdiV1CreateCodecByTypeTest_005, TestSize.Level1)
{
AvCodecMime mime = MEDIA_MIMETYPE_VIDEO_AVC;
int32_t errorCode = g_codecObj->CodecCreateByType(g_codecObj, INVALID_TYPE, mime, &g_handle);
ASSERT_EQ(errorCode, HDF_ERR_NOT_SUPPORT);
}
HWTEST_F(CodecProxyTest, HdfCodecHdiV1SetPortModeTest_001, TestSize.Level1)
{
DirectionType direct = OUTPUT_TYPE;