diff --git a/services/hdfaudioclient/test/unittest/audio_adapter_internal/audio_adapter_internal_test.cpp b/services/hdfaudioclient/test/unittest/audio_adapter_internal/audio_adapter_internal_test.cpp index ff8433108b2c570ec7ab65c7265a06ef8ce2336d..943c03b3c9c7669094a47bb139434ea653719392 100644 --- a/services/hdfaudioclient/test/unittest/audio_adapter_internal/audio_adapter_internal_test.cpp +++ b/services/hdfaudioclient/test/unittest/audio_adapter_internal/audio_adapter_internal_test.cpp @@ -168,29 +168,6 @@ HWTEST_F(AudioAdapterTest, CreateCaptureInternal_001, TestSize.Level1) EXPECT_EQ(ERR_DH_AUDIO_HDI_INVALID_PARAM, ret); } -/** -* @tc.name: CreateCaptureInternal -* @tc.desc: Verify the abnormal branch of the CreateCaptureInternal, when param is null. -* @tc.type: FUNC -* @tc.require: AR000H0E6H -*/ -HWTEST_F(AudioAdapterTest, CreateCaptureInternal_002, TestSize.Level1) -{ - const struct ::AudioDeviceDescriptor *desc = new ::AudioDeviceDescriptor; - const struct ::AudioSampleAttributes *attrs = new ::AudioSampleAttributes; - auto adapterContext1 = std::make_unique(); - struct AudioCapture *capture = new AudioCapture; - int32_t ret = adapterContext1->instance_.CreateCapture(&adapterContext1->instance_, desc, attrs, &capture); - EXPECT_EQ(ERR_DH_AUDIO_HDI_NULLPTR, ret); - auto adapterContext = std::make_unique(); - adapterContext->proxy_ = new MockIAudioAdapter(); - adapterContext->adapterName_ = "adapterName"; - EXPECT_EQ(DH_SUCCESS, adapterContext->instance_.CreateCapture(&adapterContext->instance_, desc, attrs, &capture)); - delete desc; - delete attrs; - delete capture; -} - /** * @tc.name: DestroyCaptureInternal * @tc.desc: Verify the abnormal branch of the DestroyCaptureInternal, when param is null. diff --git a/services/hdfaudioclient/test/unittest/audio_capture_internal/audio_capture_internal_test.cpp b/services/hdfaudioclient/test/unittest/audio_capture_internal/audio_capture_internal_test.cpp index 4c4680c478dc80781fe44de87ab0d127d538a2d5..636ebbc2b0bb2ae2453ccdbd5e92d16bda16aa07 100644 --- a/services/hdfaudioclient/test/unittest/audio_capture_internal/audio_capture_internal_test.cpp +++ b/services/hdfaudioclient/test/unittest/audio_capture_internal/audio_capture_internal_test.cpp @@ -58,24 +58,6 @@ HWTEST_F(AudioCaptureTest, GetCapturePositionInternal_001, TestSize.Level1) EXPECT_EQ(ERR_DH_AUDIO_HDI_INVALID_PARAM, ret); } -/** -* @tc.name: GetCapturePositionInternal -* @tc.desc: Verify the abnormal branch of the GetCapturePositionInternal, when param is null. -* @tc.type: FUNC -* @tc.require: AR000H0E6H -*/ -HWTEST_F(AudioCaptureTest, GetCapturePositionInternal_002, TestSize.Level1) -{ - struct AudioCaptureContext captureContext; - struct AudioCapture *capture = new AudioCapture; - uint64_t *frames = new uint64_t; - struct ::AudioTimeStamp *time = new ::AudioTimeStamp; - int32_t ret = captureContext.instance_.GetCapturePosition(capture, frames, time); - delete capture; - delete time; - EXPECT_EQ(ERR_DH_AUDIO_HDI_NULLPTR, ret); -} - /** * @tc.name: CaptureFrameInternal * @tc.desc: Verify the abnormal branch of the CaptureFrameInternal, when param is null. @@ -92,25 +74,5 @@ HWTEST_F(AudioCaptureTest, CaptureFrameInternal_001, TestSize.Level1) int32_t ret = captureContext.instance_.CaptureFrame(capture, frame, requestBytes, replyBytes); EXPECT_EQ(ERR_DH_AUDIO_HDI_INVALID_PARAM, ret); } - -/** -* @tc.name: CaptureFrameInternal -* @tc.desc: Verify the abnormal branch of the CaptureFrameInternal, when param is null. -* @tc.type: FUNC -* @tc.require: AR000H0E6H -*/ -HWTEST_F(AudioCaptureTest, CaptureFrameInternal_002, TestSize.Level1) -{ - struct AudioCaptureContext captureContext; - struct AudioCapture *capture = new AudioCapture; - char p = 'c'; - void *frame = &p; - uint64_t requestBytes = 1; - uint64_t *replyBytes = new uint64_t; - int32_t ret = captureContext.instance_.CaptureFrame(capture, frame, requestBytes, replyBytes); - delete capture; - delete replyBytes; - EXPECT_EQ(ERR_DH_AUDIO_HDI_NULLPTR, ret); -} } // DistributedHardware } // OHOS \ No newline at end of file diff --git a/services/hdfaudioclient/test/unittest/audio_render_internal/audio_render_internal_test.cpp b/services/hdfaudioclient/test/unittest/audio_render_internal/audio_render_internal_test.cpp index 55d84d53e6603d9b4dc79e75288aa455296853fe..648f3f1511dce697d92f49ce845b855a33e764e0 100644 --- a/services/hdfaudioclient/test/unittest/audio_render_internal/audio_render_internal_test.cpp +++ b/services/hdfaudioclient/test/unittest/audio_render_internal/audio_render_internal_test.cpp @@ -57,23 +57,6 @@ HWTEST_F(AudioRenderTest, GetLatencyInternal_001, TestSize.Level1) EXPECT_EQ(ERR_DH_AUDIO_HDI_INVALID_PARAM, ret); } -/** -* @tc.name: GetLatencyInternal -* @tc.desc: Verify the abnormal branch of the GetLatencyInternal, when param is null. -* @tc.type: FUNC -* @tc.require: AR000H0E6H -*/ -HWTEST_F(AudioRenderTest, GetLatencyInternal_002, TestSize.Level1) -{ - struct AudioRenderContext renderContext; - struct AudioRender *render = new AudioRender; - uint32_t *ms = new uint32_t; - int32_t ret = renderContext.instance_.GetLatency(render, ms); - delete render; - delete ms; - EXPECT_EQ(ERR_DH_AUDIO_HDI_NULLPTR, ret); -} - /** * @tc.name: RenderFrameInternal * @tc.desc: Verify the abnormal branch of the RenderFrameInternal, when param is null.