diff --git a/common/src/utils/dcamera_utils_tools.cpp b/common/src/utils/dcamera_utils_tools.cpp index 8d21d2d0b425e796a086c698dbb113e7dca67962..ddba00d77c70261367b9d5a3670238d1ef8283e0 100644 --- a/common/src/utils/dcamera_utils_tools.cpp +++ b/common/src/utils/dcamera_utils_tools.cpp @@ -324,7 +324,7 @@ FILE *DumpFileUtil::OpenDumpFileInner(std::string para, std::string fileName) g_lastPara[para] = dumpPara; return dumpFile; } - DHLOGD("%{public}s = %{public}s, filePath: %{public}s", para.c_str(), dumpPara.c_str(), path); + if (dumpPara == "w") { dumpFile = fopen(path, "wb+"); CHECK_AND_RETURN_RET_LOG(dumpFile == nullptr, dumpFile, "Error opening dump file!"); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/onsinklocalcamsrvdied_fuzzer/onsinklocalcamsrvdied_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/onsinklocalcamsrvdied_fuzzer/onsinklocalcamsrvdied_fuzzer.cpp index 8947d9236e8757fa04ff7c123b23f35cc0930710..ad71efacc8f797b655777ed7fcf6e8cf0115f8f4 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/onsinklocalcamsrvdied_fuzzer/onsinklocalcamsrvdied_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/onsinklocalcamsrvdied_fuzzer/onsinklocalcamsrvdied_fuzzer.cpp @@ -35,6 +35,9 @@ void OnSinkLocalCamSrvDiedFuzzTest(const uint8_t* data, size_t size) int32_t saId = *(reinterpret_cast(data)); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(saId); wptr remote (remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkonloadsystemabilitysuccess_fuzzer/sinkonloadsystemabilitysuccess_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkonloadsystemabilitysuccess_fuzzer/sinkonloadsystemabilitysuccess_fuzzer.cpp index c5f470a678be9c042cd9f2795ad18c99d2131747..b60216670b8d7bd779346d557f2fe93e6022dec2 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkonloadsystemabilitysuccess_fuzzer/sinkonloadsystemabilitysuccess_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkonloadsystemabilitysuccess_fuzzer/sinkonloadsystemabilitysuccess_fuzzer.cpp @@ -37,6 +37,9 @@ void SinkOnLoadSystemAbilitySuccessFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(systemAbilityId); callback->OnLoadSystemAbilitySuccess(systemAbilityId, remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxychannelneg_fuzzer/sinkproxychannelneg_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxychannelneg_fuzzer/sinkproxychannelneg_fuzzer.cpp index 453b1ac2d78951fc650d65b9c374682dd72496ad..d4dd02557dea9034324ee9bc1d9cfc7e0da2c2cf 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxychannelneg_fuzzer/sinkproxychannelneg_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxychannelneg_fuzzer/sinkproxychannelneg_fuzzer.cpp @@ -36,6 +36,9 @@ void SinkProxyChannelNegFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyclosechannel_fuzzer/sinkproxyclosechannel_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyclosechannel_fuzzer/sinkproxyclosechannel_fuzzer.cpp index 1bf7996ecd684ed334b5c63272824377bfb01a75..f1ac84dd67e731500d974e86ba4bfb3cd1c99f9c 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyclosechannel_fuzzer/sinkproxyclosechannel_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyclosechannel_fuzzer/sinkproxyclosechannel_fuzzer.cpp @@ -34,6 +34,9 @@ void SinkProxyCloseChannelFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxygetcamerainfo_fuzzer/sinkproxygetcamerainfo_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxygetcamerainfo_fuzzer/sinkproxygetcamerainfo_fuzzer.cpp index 09766a4f71bd643116e1d8f1385817f462f4924d..5bbd20b549a04c547e6bdf6f1a085d2cd56d9ec7 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxygetcamerainfo_fuzzer/sinkproxygetcamerainfo_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxygetcamerainfo_fuzzer/sinkproxygetcamerainfo_fuzzer.cpp @@ -36,6 +36,9 @@ void SinkProxyGetCameraInfoFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyinitsink_fuzzer/sinkproxyinitsink_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyinitsink_fuzzer/sinkproxyinitsink_fuzzer.cpp index fa85b599fc815b87920acd833695c1d93b11747b..bdf73e2fb1952bde48750c20fb6fd68de1253714 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyinitsink_fuzzer/sinkproxyinitsink_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyinitsink_fuzzer/sinkproxyinitsink_fuzzer.cpp @@ -36,6 +36,9 @@ void SinkProxyInitSinkFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyopenchannel_fuzzer/sinkproxyopenchannel_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyopenchannel_fuzzer/sinkproxyopenchannel_fuzzer.cpp index 495126a7992934391af257925eeb15104fd6c711..4d3bef6db7f6b44adbda2170ec7a97a9ba5c8655 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyopenchannel_fuzzer/sinkproxyopenchannel_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyopenchannel_fuzzer/sinkproxyopenchannel_fuzzer.cpp @@ -36,6 +36,9 @@ void SinkProxyOpenChannelFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyreleasesink_fuzzer/sinkproxyreleasesink_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyreleasesink_fuzzer/sinkproxyreleasesink_fuzzer.cpp index 13355d90235b26d387b49ac722b7fe03fd99c16c..b3d29b04c956f91a17c3b52ed365064d547a969d 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyreleasesink_fuzzer/sinkproxyreleasesink_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyreleasesink_fuzzer/sinkproxyreleasesink_fuzzer.cpp @@ -34,6 +34,9 @@ void SinkProxyReleaseSinkFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxystopcapture_fuzzer/sinkproxystopcapture_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxystopcapture_fuzzer/sinkproxystopcapture_fuzzer.cpp index 7a75bbb6fda6c0fb9932796d32867ba5addb2477..7829e4a8af35d9f46625d9b0bda442163e90cd6a 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxystopcapture_fuzzer/sinkproxystopcapture_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxystopcapture_fuzzer/sinkproxystopcapture_fuzzer.cpp @@ -35,6 +35,9 @@ void SinkProxyStopCaptureFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxysubscribelocalhardware_fuzzer/sinkproxysubscribelocalhardware_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxysubscribelocalhardware_fuzzer/sinkproxysubscribelocalhardware_fuzzer.cpp index 4ffe5f415efe25543dda4ca792158c194a235659..653940498138a6a3676628ff98b35f190c201cb3 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxysubscribelocalhardware_fuzzer/sinkproxysubscribelocalhardware_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxysubscribelocalhardware_fuzzer/sinkproxysubscribelocalhardware_fuzzer.cpp @@ -36,6 +36,9 @@ void SinkProxySubscribeLocalHardwareFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyunsubscribelocalhardware_fuzzer/sinkproxyunsubscribelocalhardware_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyunsubscribelocalhardware_fuzzer/sinkproxyunsubscribelocalhardware_fuzzer.cpp index 624c533466258ef8791a9f8c21f7ca818e748dc8..62fdc521c2c17a551d4aec09eb387990fd586118 100644 --- a/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyunsubscribelocalhardware_fuzzer/sinkproxyunsubscribelocalhardware_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sinkfuzztest/sinkproxyunsubscribelocalhardware_fuzzer/sinkproxyunsubscribelocalhardware_fuzzer.cpp @@ -35,6 +35,9 @@ void SinkProxyUnsubscribeLocalHardwareFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); std::shared_ptr dCSinkProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/onsourcelocalcamsrvdied_fuzzer/onsourcelocalcamsrvdied_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/onsourcelocalcamsrvdied_fuzzer/onsourcelocalcamsrvdied_fuzzer.cpp index d88493ec987e90b8754ed23c601989f0b443e559..d5473d44efaf11a7a40f209bd9049917d2bd0a16 100644 --- a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/onsourcelocalcamsrvdied_fuzzer/onsourcelocalcamsrvdied_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/onsourcelocalcamsrvdied_fuzzer/onsourcelocalcamsrvdied_fuzzer.cpp @@ -35,6 +35,9 @@ void OnSourceLocalCamSrvDiedFuzzTest(const uint8_t* data, size_t size) int32_t saId = *(reinterpret_cast(data)); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(saId); wptr remote (remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxydcameranotify_fuzzer/sourceproxydcameranotify_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxydcameranotify_fuzzer/sourceproxydcameranotify_fuzzer.cpp index 3a943a543a681985e4b90851fbbfb45f4c0710ef..8db6750311f033b8de83efde942edd111e898474 100644 --- a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxydcameranotify_fuzzer/sourceproxydcameranotify_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxydcameranotify_fuzzer/sourceproxydcameranotify_fuzzer.cpp @@ -35,6 +35,9 @@ void SourceProxyDCameraNotifyFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); std::shared_ptr dCSourceProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyinitsource_fuzzer/sourceproxyinitsource_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyinitsource_fuzzer/sourceproxyinitsource_fuzzer.cpp index 44fca0f19244457b16545067cf19b4392df090e8..504228f7d13a143885d432b3b6d8359243a9fbb7 100644 --- a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyinitsource_fuzzer/sourceproxyinitsource_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyinitsource_fuzzer/sourceproxyinitsource_fuzzer.cpp @@ -32,6 +32,9 @@ void SourceProxyInitSourceFuzzTest(const uint8_t* data, size_t size) sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); std::shared_ptr dCSourceProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyregisterdistributedhardware_fuzzer/sourceproxyregisterdistributedhardware_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyregisterdistributedhardware_fuzzer/sourceproxyregisterdistributedhardware_fuzzer.cpp index e04c84d8c7515411c956b318aaabcc051253f2e8..ee6443be636afb97b014d42f3018aef914012b68 100644 --- a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyregisterdistributedhardware_fuzzer/sourceproxyregisterdistributedhardware_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyregisterdistributedhardware_fuzzer/sourceproxyregisterdistributedhardware_fuzzer.cpp @@ -44,6 +44,9 @@ void SourceProxyRegisterDistributedHardwareFuzzTest(const uint8_t* data, size_t sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); std::shared_ptr dCSourceProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyunregisterdistributedhardware_fuzzer/sourceproxyunregisterdistributedhardware_fuzzer.cpp b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyunregisterdistributedhardware_fuzzer/sourceproxyunregisterdistributedhardware_fuzzer.cpp index 713d0c93cf6d23e8a7df8087813dbbc1ea876556..e16eb98c5a835230f09c695354bbe06c00acd183 100644 --- a/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyunregisterdistributedhardware_fuzzer/sourceproxyunregisterdistributedhardware_fuzzer.cpp +++ b/interfaces/inner_kits/native_cpp/test/sourcefuzztest/sourceproxyunregisterdistributedhardware_fuzzer/sourceproxyunregisterdistributedhardware_fuzzer.cpp @@ -35,6 +35,9 @@ void SourceProxyUnregisterDistributedHardwareFuzzTest(const uint8_t* data, size_ sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + if (samgr == nullptr) { + return; + } sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); std::shared_ptr dCSourceProxy = std::make_shared(remoteObject); diff --git a/interfaces/inner_kits/native_cpp/test/unittest/common/camera_sink/dcamera_sink_handler_ipc_test.cpp b/interfaces/inner_kits/native_cpp/test/unittest/common/camera_sink/dcamera_sink_handler_ipc_test.cpp index dc5a4101754bad56740d5555bc56ef67579b9d48..c63ffb9a391c9a1b454644234a210659bdf45cf2 100644 --- a/interfaces/inner_kits/native_cpp/test/unittest/common/camera_sink/dcamera_sink_handler_ipc_test.cpp +++ b/interfaces/inner_kits/native_cpp/test/unittest/common/camera_sink/dcamera_sink_handler_ipc_test.cpp @@ -134,6 +134,7 @@ HWTEST_F(DCameraSinkHandlerIpcTest, dcamera_sink_handler_ipc_test_005, TestSize. int32_t systemAbilityId = 4804; sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); wptr remoteObject = samgr->GetSystemAbility(systemAbilityId); DCameraSinkHandlerIpc::GetInstance().OnSinkLocalCamSrvDied(remoteObject); EXPECT_EQ(nullptr, DCameraSinkHandlerIpc::GetInstance().localSink_); 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 5c64ce86b372e3cf85d5fbb06800623ea2d41376..8a5c7122819b2f32ddafb4e18816193e51ceb706 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 @@ -168,6 +168,7 @@ HWTEST_F(DCameraSinkHandlerTest, dcamera_sink_handler_test_005, TestSize.Level1) int32_t systemAbilityId = 4804; sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(systemAbilityId); sptr loadCallback(new DCameraSinkLoadCallback(params)); ASSERT_NE(loadCallback, nullptr); diff --git a/interfaces/inner_kits/native_cpp/test/unittest/common/camera_source/dcamera_source_handler_ipc_test.cpp b/interfaces/inner_kits/native_cpp/test/unittest/common/camera_source/dcamera_source_handler_ipc_test.cpp index a0f2fa77a8d2287fc999c736251c410cf7a2e3e3..9528dc7b1054af349d6de0cd08a5dc0444cab310 100644 --- a/interfaces/inner_kits/native_cpp/test/unittest/common/camera_source/dcamera_source_handler_ipc_test.cpp +++ b/interfaces/inner_kits/native_cpp/test/unittest/common/camera_source/dcamera_source_handler_ipc_test.cpp @@ -134,6 +134,7 @@ HWTEST_F(DCameraSourceHandlerIpcTest, dcamera_source_handler_ipc_test_005, TestS int32_t systemAbilityId = 4803; sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); wptr remoteObject = samgr->GetSystemAbility(systemAbilityId); DCameraSourceHandlerIpc::GetInstance().OnSourceLocalCamSrvDied(remoteObject); EXPECT_EQ(nullptr, DCameraSourceHandlerIpc::GetInstance().localSource_); diff --git a/interfaces/inner_kits/native_cpp/test/unittest/common/camera_source/dcamera_source_handler_test.cpp b/interfaces/inner_kits/native_cpp/test/unittest/common/camera_source/dcamera_source_handler_test.cpp index 616bee39218593955af0bd0013bdede7b473f267..d72a7d4bbf3986b5b25b33671e80d8a619ea6d7a 100644 --- a/interfaces/inner_kits/native_cpp/test/unittest/common/camera_source/dcamera_source_handler_test.cpp +++ b/interfaces/inner_kits/native_cpp/test/unittest/common/camera_source/dcamera_source_handler_test.cpp @@ -154,6 +154,7 @@ HWTEST_F(DCameraSourceHandlerTest, dcamera_source_handler_test_005, TestSize.Lev int32_t systemAbilityId = 4803; sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(systemAbilityId); sptr loadCallback(new DCameraSourceLoadCallback(params)); ASSERT_NE(loadCallback, nullptr); diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcamera/dcamera_sink_callback_proxy_test.cpp b/services/cameraservice/sinkservice/test/unittest/common/distributedcamera/dcamera_sink_callback_proxy_test.cpp index 1dcd4b7389f659de556b336d84795d6e06d4826c..6348a813aab41433c634edcee0c5d3489cbc7251 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcamera/dcamera_sink_callback_proxy_test.cpp +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcamera/dcamera_sink_callback_proxy_test.cpp @@ -67,6 +67,7 @@ HWTEST_F(DcameraSinkCallbackProxyTest, dcamera_sink_callback_proxy_test_001, Tes DHLOGI("DcameraSinkCallbackProxyTest::dcamera_sink_callback_proxy_test_001"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); sptr callbackProxy(new DCameraSinkCallbackProxy(remoteObject)); EXPECT_EQ(false, callbackProxy == nullptr); diff --git a/services/cameraservice/sourceservice/test/unittest/common/distributedcamera/dcamera_source_callback_proxy_test.cpp b/services/cameraservice/sourceservice/test/unittest/common/distributedcamera/dcamera_source_callback_proxy_test.cpp index 6ba64b5df2dcf50fefcebb0e22630125274df90b..dd8cd63c54a8d2385a02d3628c1045bc938946cf 100644 --- a/services/cameraservice/sourceservice/test/unittest/common/distributedcamera/dcamera_source_callback_proxy_test.cpp +++ b/services/cameraservice/sourceservice/test/unittest/common/distributedcamera/dcamera_source_callback_proxy_test.cpp @@ -74,6 +74,7 @@ HWTEST_F(DcameraSourceCallbackProxyTest, dcamera_source_callback_proxy_test_001, DHLOGI("DcameraSourceCallbackProxyTest::dcamera_source_callback_proxy_test_001"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); sptr callbackProxy(new DCameraSourceCallbackProxy(remoteObject)); EXPECT_EQ(false, callbackProxy == nullptr); @@ -98,6 +99,7 @@ HWTEST_F(DcameraSourceCallbackProxyTest, dcamera_source_callback_proxy_test_002, DHLOGI("DcameraSourceCallbackProxyTest::dcamera_source_callback_proxy_test_002"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); sptr callbackProxy(new DCameraSourceCallbackProxy(remoteObject)); EXPECT_EQ(false, callbackProxy == nullptr); @@ -122,6 +124,7 @@ HWTEST_F(DcameraSourceCallbackProxyTest, dcamera_source_callback_proxy_test_003, DHLOGI("DcameraSourceCallbackProxyTest::dcamera_source_callback_proxy_test_003"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); sptr callbackProxy(new DCameraSourceCallbackProxy(remoteObject)); EXPECT_EQ(false, callbackProxy == nullptr); @@ -145,6 +148,7 @@ HWTEST_F(DcameraSourceCallbackProxyTest, dcamera_source_callback_proxy_test_004, DHLOGI("DcameraSourceCallbackProxyTest::dcamera_source_callback_proxy_test_004"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); sptr callbackProxy(new DCameraSourceCallbackProxy(remoteObject)); EXPECT_EQ(false, callbackProxy == nullptr); @@ -183,6 +187,7 @@ HWTEST_F(DcameraSourceCallbackProxyTest, CheckParams_001, TestSize.Level1) DHLOGI("DcameraSourceCallbackProxyTest::CheckParams_001"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); sptr callbackProxy(new DCameraSourceCallbackProxy(remoteObject)); @@ -210,6 +215,7 @@ HWTEST_F(DcameraSourceCallbackProxyTest, OnDataSyncTrigger_001, TestSize.Level1) DHLOGI("DcameraSourceCallbackProxyTest::OnDataSyncTrigger_001"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); sptr callbackProxy(new DCameraSourceCallbackProxy(remoteObject)); @@ -245,6 +251,7 @@ HWTEST_F(DcameraSourceCallbackProxyTest, OnHardwareStateChanged_001, TestSize.Le DHLOGI("DcameraSourceCallbackProxyTest::OnHardwareStateChanged_001"); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); sptr callbackProxy(new DCameraSourceCallbackProxy(remoteObject)); diff --git a/services/cameraservice/sourceservice/test/unittest/common/distributedcamera/distributed_camera_source_service_test.cpp b/services/cameraservice/sourceservice/test/unittest/common/distributedcamera/distributed_camera_source_service_test.cpp index 418c0cdca8cdcaeb2f4e5f0a8c9159244cb97121..7caa25a36b5fcd1e82eca13c1e92cbc349ac6744 100644 --- a/services/cameraservice/sourceservice/test/unittest/common/distributedcamera/distributed_camera_source_service_test.cpp +++ b/services/cameraservice/sourceservice/test/unittest/common/distributedcamera/distributed_camera_source_service_test.cpp @@ -180,6 +180,7 @@ HWTEST_F(DistributedCameraSourceServiceTest, dcamera_source_service_test_006, Te std::string params = "test006"; sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); sptr remoteObject = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID); sptr callbackProxy(new DCameraSourceCallbackProxy(remoteObject)); testSrcService_->listener_ = std::make_shared(); diff --git a/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/dcamera_source_service_ipc_test.cpp b/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/dcamera_source_service_ipc_test.cpp index 0a22b70ce55557413680e02a971e6b37d67de90f..4e8a425edf6643e1556af83b1fd09ba24a43f365 100644 --- a/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/dcamera_source_service_ipc_test.cpp +++ b/services/cameraservice/sourceservice/test/unittest/common/distributedcameramgr/dcamera_source_service_ipc_test.cpp @@ -142,6 +142,7 @@ HWTEST_F(DCameraSourceServiceIpcTest, dcamera_source_service_ipc_test_005, TestS DCameraSourceServiceIpc::GetInstance().Init(); sptr samgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager(); + ASSERT_NE(samgr, nullptr); wptr remote = samgr->GetSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID); DCameraSourceServiceIpc::GetInstance().OnSinkRemoteCamSrvDied(remote); DCameraSourceServiceIpc::GetInstance().UnInit(); diff --git a/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp b/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp index d2c7c0d37f3c7e381847bf6c7cf081a02c6806df..9aac898e69a08344fa53dd9a6d73d213bd96d4a5 100644 --- a/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp +++ b/services/data_process/src/pipeline_node/fpscontroller/fps_controller_process.cpp @@ -269,7 +269,7 @@ bool FpsControllerProcess::IsDropFrame(float incomingFps) bool FpsControllerProcess::ReduceFrameRateByUniformStrategy(int32_t incomingFrmRate) { DHLOGD("Frame control, reduce frame rate by uniform rate strategy"); - if (incomingFrmRate > targetFrameRate_) { + if (incomingFrmRate <= targetFrameRate_) { DHLOGD("incoming fps not more than targetFrameRate_, not drop"); return false; }