From a5f59d2eb0e83acca47f4b80b08d068493d4d3d8 Mon Sep 17 00:00:00 2001 From: chensihan Date: Wed, 12 Mar 2025 14:41:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chensihan --- .../module_ipc/service_other_test.cpp | 33 ++ .../backup_sa/module_ipc/service_test.cpp | 293 ++++++++++++++++++ 2 files changed, 326 insertions(+) diff --git a/tests/unittests/backup_sa/module_ipc/service_other_test.cpp b/tests/unittests/backup_sa/module_ipc/service_other_test.cpp index 30ea8f00e..bb0876538 100644 --- a/tests/unittests/backup_sa/module_ipc/service_other_test.cpp +++ b/tests/unittests/backup_sa/module_ipc/service_other_test.cpp @@ -855,6 +855,39 @@ HWTEST_F(ServiceTest, SUB_Service_AppendBundlesRestoreSession_0200, TestSize.Lev GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_AppendBundlesRestoreSession_0200"; } +/** + * @tc.number: SUB_Service_AppendBundlesRestoreSession_0300 + * @tc.name: SUB_Service_AppendBundlesRestoreSession_0300 + * @tc.desc: 测试 AppendBundlesRestoreSession + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: issueIAKC3I + */ +HWTEST_F(ServiceTest, SUB_Service_AppendBundlesRestoreSession_0300, TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_AppendBundlesRestoreSession_0300"; + try { + ASSERT_TRUE(service != nullptr); + std::vector bundleNames; + RestoreTypeEnum restoreType = RESTORE_DATA_READDY; + int32_t userId = 100; + + service->session_ = nullptr; + auto ret = service->AppendBundlesRestoreSession(UniqueFd(-1), bundleNames, restoreType, userId); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + + service->session_ = sptr(new SvcSessionManager(wptr(service))); + service->isOccupyingSession_.store(true); + ret = service->AppendBundlesRestoreSession(UniqueFd(-1), bundleNames, restoreType, userId); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by AppendBundlesRestoreSession."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_AppendBundlesRestoreSession_0300"; +} + /** * @tc.number: SUB_Service_SetCurrentSessProperties_0100 * @tc.name: SUB_Service_SetCurrentSessProperties_0100 diff --git a/tests/unittests/backup_sa/module_ipc/service_test.cpp b/tests/unittests/backup_sa/module_ipc/service_test.cpp index ba99f49ff..8f49de2d1 100644 --- a/tests/unittests/backup_sa/module_ipc/service_test.cpp +++ b/tests/unittests/backup_sa/module_ipc/service_test.cpp @@ -362,6 +362,90 @@ HWTEST_F(ServiceTest, SUB_Service_AppFileReady_0102, testing::ext::TestSize.Leve GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_AppFileReady_0102"; } +/** + * @tc.number: SUB_Service_AppFileReady_0103 + * @tc.name: SUB_Service_AppFileReady_0103 + * @tc.desc: 测试 AppFileReady 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I6F3GV + */ +HWTEST_F(ServiceTest, SUB_Service_AppFileReady_0103, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_AppFileReady_0103"; + try { + string fileName = "/manage.json"; + EXPECT_TRUE(servicePtr_ != nullptr); + auto ret = servicePtr_->AppFileReady(fileName, UniqueFd(-1), 0); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by AppFileReady."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_AppFileReady_0103"; +} + +/** + * @tc.number: SUB_Service_RefreshDataSize_0100 + * @tc.name: SUB_Service_RefreshDataSize_0100 + * @tc.desc: 测试 RefreshDataSize 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I6F3GV + */ +HWTEST_F(ServiceTest, SUB_Service_RefreshDataSize_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_RefreshDataSize_0100"; + try { + string fileName = MANAGE_JSON; + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->session_ = nullptr; + auto ret = servicePtr_->RefreshDataSize(0); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + + servicePtr_->session_ = sptr(new SvcSessionManager(servicePtr_)); + ret = servicePtr_->RefreshDataSize(0); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by RefreshDataSize."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_RefreshDataSize_0100"; +} + +/** + * @tc.number: SUB_Service_StopExtTimer_0100 + * @tc.name: SUB_Service_StopExtTimer_0100 + * @tc.desc: 测试 StopExtTimer 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I6F3GV + */ +HWTEST_F(ServiceTest, SUB_Service_StopExtTimer_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_StopExtTimer_0100"; + try { + string fileName = MANAGE_JSON; + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->session_ = nullptr; + bool isExtStop = false; + + auto ret = servicePtr_->StopExtTimer(isExtStop); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + + servicePtr_->session_ = sptr(new SvcSessionManager(servicePtr_)); + ret = servicePtr_->StopExtTimer(isExtStop); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by StopExtTimer."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_StopExtTimer_0100"; +} + /** * @tc.number: SUB_Service_AppDone_0100 * @tc.name: SUB_Service_AppDone_0100 @@ -1793,4 +1877,213 @@ HWTEST_F(ServiceTest, SUB_Service_DeleteDisConfigFile_0100, testing::ext::TestSi } GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_DeleteDisConfigFile_0100"; } + +/** + * @tc.number: SUB_Service_ExtensionConnectFailRadarReport_0100 + * @tc.name: SUB_Service_ExtensionConnectFailRadarReport_0100 + * @tc.desc: 测试 ExtensionConnectFailRadarReport 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I8ZIMJ + */ +HWTEST_F(ServiceTest, SUB_Service_ExtensionConnectFailRadarReport_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_ExtensionConnectFailRadarReport_0100"; + try { + ErrCode ret = Init(IServiceReverse::Scenario::BACKUP); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->ClearBundleRadarReport(); + servicePtr_->ExtensionConnectFailRadarReport(BUNDLE_NAME, BError(BError::Codes::OK), + IServiceReverse::Scenario::BACKUP); + EXPECT_TRUE(true); + + ret = Init(IServiceReverse::Scenario::RESTORE); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + servicePtr_->ExtensionConnectFailRadarReport(BUNDLE_NAME, BError(BError::Codes::OK), + IServiceReverse::Scenario::RESTORE); + EXPECT_TRUE(true); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by ExtensionConnectFailRadarReport."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_ExtensionConnectFailRadarReport_0100"; +} + +/** + * @tc.number: SUB_Service_StartRunningTimer_0100 + * @tc.name: SUB_Service_StartRunningTimer_0100 + * @tc.desc: 测试 StartRunningTimer 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I8ZIMJ + */ +HWTEST_F(ServiceTest, SUB_Service_StartRunningTimer_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_StartRunningTimer_0100"; + try { + ErrCode ret = Init(IServiceReverse::Scenario::BACKUP); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->StartRunningTimer(BUNDLE_NAME); + EXPECT_TRUE(true); + + ret = Init(IServiceReverse::Scenario::RESTORE); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + servicePtr_->StartRunningTimer(BUNDLE_NAME); + EXPECT_TRUE(true); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by StartRunningTimer."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_StartRunningTimer_0100"; +} + +/** + * @tc.number: SUB_Service_TimeoutRadarReport_0100 + * @tc.name: SUB_Service_TimeoutRadarReport_0100 + * @tc.desc: 测试 TimeoutRadarReport 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I8ZIMJ + */ +HWTEST_F(ServiceTest, SUB_Service_TimeoutRadarReport_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_TimeoutRadarReport_0100"; + try { + ErrCode ret = Init(IServiceReverse::Scenario::BACKUP); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + EXPECT_TRUE(servicePtr_ != nullptr); + std::string bundleName = BUNDLE_NAME; + servicePtr_->ClearBundleRadarReport(); + servicePtr_->TimeoutRadarReport(IServiceReverse::Scenario::BACKUP, bundleName); + EXPECT_TRUE(true); + + ret = Init(IServiceReverse::Scenario::RESTORE); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + servicePtr_->TimeoutRadarReport(IServiceReverse::Scenario::RESTORE, bundleName); + EXPECT_TRUE(true); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by TimeoutRadarReport."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_TimeoutRadarReport_0100"; +} + +/** + * @tc.number: SUB_Service_ReportOnBundleStarted_0100 + * @tc.name: SUB_Service_ReportOnBundleStarted_0100 + * @tc.desc: 测试 ReportOnBundleStarted 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I8ZIMJ + */ +HWTEST_F(ServiceTest, SUB_Service_ReportOnBundleStarted_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_ReportOnBundleStarted_0100"; + try { + ErrCode ret = Init(IServiceReverse::Scenario::BACKUP); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->ReportOnBundleStarted(IServiceReverse::Scenario::BACKUP, BUNDLE_NAME); + EXPECT_TRUE(true); + + ret = Init(IServiceReverse::Scenario::RESTORE); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + servicePtr_->ReportOnBundleStarted(IServiceReverse::Scenario::RESTORE, BUNDLE_NAME); + EXPECT_TRUE(true); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by ReportOnBundleStarted."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_ReportOnBundleStarted_0100"; +} + +/** + * @tc.number: SUB_Service_HandleNotSupportBundleNames_0100 + * @tc.name: SUB_Service_HandleNotSupportBundleNames_0100 + * @tc.desc: 测试 HandleNotSupportBundleNames 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I8ZIMJ + */ +HWTEST_F(ServiceTest, SUB_Service_HandleNotSupportBundleNames_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_HandleNotSupportBundleNames_0100"; + try { + ErrCode ret = Init(IServiceReverse::Scenario::BACKUP); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + EXPECT_TRUE(servicePtr_ != nullptr); + const std::vector srcBundleNames = {"test0", "test1", "test2", "test3"}; + std::vector supportBundleNames = {"test2", "test3", "test4", "test5"}; + + servicePtr_->HandleNotSupportBundleNames(srcBundleNames, supportBundleNames, false); + EXPECT_TRUE(true); + servicePtr_->HandleNotSupportBundleNames(srcBundleNames, supportBundleNames, true); + EXPECT_TRUE(true); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by HandleNotSupportBundleNames."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_HandleNotSupportBundleNames_0100"; +} + +/** + * @tc.number: SUB_Service_PublishFile_0103 + * @tc.name: SUB_Service_PublishFile_0103 + * @tc.desc: 测试 PublishFile 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I6F3GV + */ +HWTEST_F(ServiceTest, SUB_Service_PublishFile_0103, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_PublishFile_0103"; + try { + ErrCode ret = Init(IServiceReverse::Scenario::RESTORE); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + BFileInfo fileInfo {BUNDLE_NAME, "", 0}; + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->session_ = nullptr; + ret = servicePtr_->PublishFile(fileInfo); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + servicePtr_->session_ = sptr(new SvcSessionManager(servicePtr_)); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by PublishFile."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_PublishFile_0103"; +} + +/** + * @tc.number: SUB_Service_AppFileReady_0104 + * @tc.name: SUB_Service_AppFileReady_0104 + * @tc.desc: 测试 AppFileReady 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I6F3GV + */ +HWTEST_F(ServiceTest, SUB_Service_AppFileReady_0104, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_AppFileReady_0104"; + try { + string fileName = "manage.json"; + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->session_ = nullptr; + auto ret = servicePtr_->AppFileReady(fileName, UniqueFd(-1), 0); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + servicePtr_->session_ = sptr(new SvcSessionManager(servicePtr_)); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by AppFileReady."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_AppFileReady_0104"; +} } // namespace OHOS::FileManagement::Backup \ No newline at end of file -- Gitee From 7b1033da7bec4a1c143be64ed3716df9b604a8a7 Mon Sep 17 00:00:00 2001 From: chensihan Date: Wed, 12 Mar 2025 16:10:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9ut=20Signed-off-by:=20che?= =?UTF-8?q?nsihan=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backup_sa/module_ipc/service_test.cpp | 120 +++++++++--------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/tests/unittests/backup_sa/module_ipc/service_test.cpp b/tests/unittests/backup_sa/module_ipc/service_test.cpp index 8f49de2d1..2f0955569 100644 --- a/tests/unittests/backup_sa/module_ipc/service_test.cpp +++ b/tests/unittests/backup_sa/module_ipc/service_test.cpp @@ -386,66 +386,6 @@ HWTEST_F(ServiceTest, SUB_Service_AppFileReady_0103, testing::ext::TestSize.Leve GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_AppFileReady_0103"; } -/** - * @tc.number: SUB_Service_RefreshDataSize_0100 - * @tc.name: SUB_Service_RefreshDataSize_0100 - * @tc.desc: 测试 RefreshDataSize 接口 - * @tc.size: MEDIUM - * @tc.type: FUNC - * @tc.level Level 1 - * @tc.require: I6F3GV - */ -HWTEST_F(ServiceTest, SUB_Service_RefreshDataSize_0100, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_RefreshDataSize_0100"; - try { - string fileName = MANAGE_JSON; - EXPECT_TRUE(servicePtr_ != nullptr); - servicePtr_->session_ = nullptr; - auto ret = servicePtr_->RefreshDataSize(0); - EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); - - servicePtr_->session_ = sptr(new SvcSessionManager(servicePtr_)); - ret = servicePtr_->RefreshDataSize(0); - EXPECT_EQ(ret, BError(BError::Codes::OK)); - } catch (...) { - EXPECT_TRUE(false); - GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by RefreshDataSize."; - } - GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_RefreshDataSize_0100"; -} - -/** - * @tc.number: SUB_Service_StopExtTimer_0100 - * @tc.name: SUB_Service_StopExtTimer_0100 - * @tc.desc: 测试 StopExtTimer 接口 - * @tc.size: MEDIUM - * @tc.type: FUNC - * @tc.level Level 1 - * @tc.require: I6F3GV - */ -HWTEST_F(ServiceTest, SUB_Service_StopExtTimer_0100, testing::ext::TestSize.Level1) -{ - GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_StopExtTimer_0100"; - try { - string fileName = MANAGE_JSON; - EXPECT_TRUE(servicePtr_ != nullptr); - servicePtr_->session_ = nullptr; - bool isExtStop = false; - - auto ret = servicePtr_->StopExtTimer(isExtStop); - EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); - - servicePtr_->session_ = sptr(new SvcSessionManager(servicePtr_)); - ret = servicePtr_->StopExtTimer(isExtStop); - EXPECT_EQ(ret, BError(BError::Codes::OK)); - } catch (...) { - EXPECT_TRUE(false); - GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by StopExtTimer."; - } - GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_StopExtTimer_0100"; -} - /** * @tc.number: SUB_Service_AppDone_0100 * @tc.name: SUB_Service_AppDone_0100 @@ -2033,6 +1973,66 @@ HWTEST_F(ServiceTest, SUB_Service_HandleNotSupportBundleNames_0100, testing::ext GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_HandleNotSupportBundleNames_0100"; } +/** + * @tc.number: SUB_Service_RefreshDataSize_0100 + * @tc.name: SUB_Service_RefreshDataSize_0100 + * @tc.desc: 测试 RefreshDataSize 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I6F3GV + */ +HWTEST_F(ServiceTest, SUB_Service_RefreshDataSize_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_RefreshDataSize_0100"; + try { + string fileName = MANAGE_JSON; + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->session_ = nullptr; + auto ret = servicePtr_->RefreshDataSize(0); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + + servicePtr_->session_ = sptr(new SvcSessionManager(servicePtr_)); + ret = servicePtr_->RefreshDataSize(0); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by RefreshDataSize."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_RefreshDataSize_0100"; +} + +/** + * @tc.number: SUB_Service_StopExtTimer_0100 + * @tc.name: SUB_Service_StopExtTimer_0100 + * @tc.desc: 测试 StopExtTimer 接口 + * @tc.size: MEDIUM + * @tc.type: FUNC + * @tc.level Level 1 + * @tc.require: I6F3GV + */ +HWTEST_F(ServiceTest, SUB_Service_StopExtTimer_0100, testing::ext::TestSize.Level1) +{ + GTEST_LOG_(INFO) << "ServiceTest-begin SUB_Service_StopExtTimer_0100"; + try { + string fileName = MANAGE_JSON; + EXPECT_TRUE(servicePtr_ != nullptr); + servicePtr_->session_ = nullptr; + bool isExtStop = false; + + auto ret = servicePtr_->StopExtTimer(isExtStop); + EXPECT_EQ(ret, BError(BError::Codes::SA_INVAL_ARG)); + + servicePtr_->session_ = sptr(new SvcSessionManager(servicePtr_)); + ret = servicePtr_->StopExtTimer(isExtStop); + EXPECT_EQ(ret, BError(BError::Codes::OK)); + } catch (...) { + EXPECT_TRUE(false); + GTEST_LOG_(INFO) << "ServiceTest-an exception occurred by StopExtTimer."; + } + GTEST_LOG_(INFO) << "ServiceTest-end SUB_Service_StopExtTimer_0100"; +} + /** * @tc.number: SUB_Service_PublishFile_0103 * @tc.name: SUB_Service_PublishFile_0103 -- Gitee