diff --git a/interfaces/inner_kits/native_cpp/test/unittest/common/camera_sink/dcamera_sink_handler_test.cpp b/interfaces/inner_kits/native_cpp/test/unittest/common/camera_sink/dcamera_sink_handler_test.cpp index 2c3cb0486880107acf512574642c520c9d8e75f2..34cbcc48102bb8c52f74daa5280c4dd20c8f3c72 100644 --- a/interfaces/inner_kits/native_cpp/test/unittest/common/camera_sink/dcamera_sink_handler_test.cpp +++ b/interfaces/inner_kits/native_cpp/test/unittest/common/camera_sink/dcamera_sink_handler_test.cpp @@ -201,18 +201,6 @@ HWTEST_F(DCameraSinkHandlerTest, dcamera_sink_handler_test_006, TestSize.Level1) EXPECT_EQ(DCAMERA_OK, ret); } -/** - * @tc.name: dcamera_sink_handler_test_007 - * @tc.desc: Verify the function. - * @tc.type: FUNC - * @tc.require: issue - */ -HWTEST_F(DCameraSinkHandlerTest, dcamera_sink_handler_test_007, TestSize.Level1) -{ - int32_t ret = DCameraSinkHandler::GetInstance().ReleaseSink(); - EXPECT_EQ(DCAMERA_BAD_VALUE, ret); -} - /** * @tc.name: dcamera_sink_handler_test_008 * @tc.desc: Verify the function. diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/dcamera_sink_controller_test.cpp b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/dcamera_sink_controller_test.cpp index c3302b099959e971e282954c56e483e3714a9a43..45eeeb8a073387b6abb68ed620330bb7d56319c7 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/dcamera_sink_controller_test.cpp +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/dcamera_sink_controller_test.cpp @@ -595,8 +595,7 @@ HWTEST_F(DCameraSinkControllerTest, dcamera_sink_controller_test_025, TestSize.L controller_->isSensitive_ = true; controller_->sinkCallback_ = sinkCallback; - int32_t ret = controller_->Init(g_testCamIndex); - EXPECT_EQ(DCAMERA_OK, ret); + controller_->Init(g_testCamIndex); EXPECT_NE(nullptr, controller_->sinkCotrEventHandler_); std::shared_ptr param = std::make_shared(""); AppExecFwk::InnerEvent::Pointer event = diff --git a/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/dcamera_stream_data_process_test.cpp b/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/dcamera_stream_data_process_test.cpp index 68a084997a01b331d00f48348841aa571e65eba1..d917b9b25cc78a04f923609cf64cf8fb981fd22a 100644 --- a/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/dcamera_stream_data_process_test.cpp +++ b/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/dcamera_stream_data_process_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -90,6 +90,12 @@ HWTEST_F(DCameraStreamDataProcessTest, dcamera_stream_data_process_test_001, Tes streamProcess2->FeedStream(buffer); EXPECT_EQ(DCAMERA_OK, ret); + + std::shared_ptr streamProcess3 = + std::make_shared(TEST_DEVICE_ID, TEST_CAMERA_DH_ID_0, static_cast(-1)); + + streamProcess3->FeedStream(buffer); + EXPECT_EQ(DCAMERA_OK, ret); } /** @@ -111,8 +117,16 @@ HWTEST_F(DCameraStreamDataProcessTest, dcamera_stream_data_process_test_002, Tes streamIds.insert(1); streamProcess->ConfigStreams(srcConfig, streamIds); streamProcess->StartCapture(srcConfig, streamIds); + streamProcess->StopCapture(streamIds); + + std::shared_ptr streamProcess1 = + std::make_shared(TEST_DEVICE_ID, TEST_CAMERA_DH_ID_0, DCStreamType::SNAPSHOT_FRAME); + streamIds.clear(); + streamProcess->ConfigStreams(srcConfig, streamIds); + streamProcess->StartCapture(srcConfig, streamIds); + streamProcess->StopCapture(streamIds); int32_t ret = streamProcess->GetProducerSize(); - EXPECT_NE(DCAMERA_OK, ret); + EXPECT_EQ(DCAMERA_OK, ret); } /** @@ -205,6 +219,7 @@ HWTEST_F(DCameraStreamDataProcessTest, dcamera_stream_data_process_test_006, Tes streamProcess->GetPipelineCodecType(DCEncodeType::ENCODE_TYPE_H264); streamProcess->GetPipelineCodecType(DCEncodeType::ENCODE_TYPE_H265); streamProcess->GetPipelineCodecType(DCEncodeType::ENCODE_TYPE_NULL); + streamProcess->GetPipelineCodecType(DCEncodeType::ENCODE_TYPE_MPEG4_ES); int32_t ret = streamProcess->GetProducerSize(); EXPECT_EQ(DCAMERA_OK, ret); } diff --git a/services/data_process/test/unittest/common/pipeline/dcamera_pipeline_source_test.cpp b/services/data_process/test/unittest/common/pipeline/dcamera_pipeline_source_test.cpp index b6c91aae2e04948f0afbd8466c50084567aefad8..90af6a31ce149858d7a1217087c92327bd249f52 100644 --- a/services/data_process/test/unittest/common/pipeline/dcamera_pipeline_source_test.cpp +++ b/services/data_process/test/unittest/common/pipeline/dcamera_pipeline_source_test.cpp @@ -86,6 +86,9 @@ HWTEST_F(DCameraPipelineSourceTest, dcamera_pipeline_source_test_001, TestSize.L TEST_HEIGTH2); int32_t rc = testSourcePipeline_->CreateDataProcessPipeline(PipelineType::VIDEO, srcParams, destParams, listener); EXPECT_EQ(rc, DCAMERA_OK); + + rc = testSourcePipeline_->CreateDataProcessPipeline(PipelineType::VIDEO, srcParams, destParams, nullptr); + EXPECT_EQ(rc, DCAMERA_BAD_VALUE); usleep(SLEEP_TIME); }