diff --git a/services/samgr/native/test/unittest/include/system_ability_manager_mock.h b/services/samgr/native/test/unittest/include/system_ability_manager_mock.h index 1e356b02e2fbbc306c88e3ae4c8f157d87f6359b..01997ed9a1fe62e9fc7e473834056f1214efd369 100644 --- a/services/samgr/native/test/unittest/include/system_ability_manager_mock.h +++ b/services/samgr/native/test/unittest/include/system_ability_manager_mock.h @@ -63,6 +63,10 @@ public: int32_t UnloadAllIdleSystemAbility() override; + int32_t UnloadProcess(const std::vector& processList) override; + + int32_t GetLruIdleSystemAbilityProc(std::vector& processInfos) override; + int32_t GetSystemProcessInfo(int32_t systemAbilityId, SystemProcessInfo& systemProcessInfo) override; int32_t GetRunningSystemProcess(std::list& systemProcessInfos) override; diff --git a/services/samgr/native/test/unittest/src/system_ability_manager_mock.cpp b/services/samgr/native/test/unittest/src/system_ability_manager_mock.cpp index f1f740f190803acc942a1d65d7991e3706ec35aa..28b8cf4acb827033532cba35fb81b10c84a90943 100644 --- a/services/samgr/native/test/unittest/src/system_ability_manager_mock.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_manager_mock.cpp @@ -118,6 +118,16 @@ int32_t ISystemAbilityManagerMock::UnloadAllIdleSystemAbility() return 0; } +int32_t ISystemAbilityManagerMock::UnloadProcess(const std::vector& processList) +{ + return 0; +} + +int32_t ISystemAbilityManagerMock::GetLruIdleSystemAbilityProc(std::vector& processInfos) +{ + return 0; +} + int32_t ISystemAbilityManagerMock::GetSystemProcessInfo(int32_t systemAbilityId, SystemProcessInfo& systemProcessInfo) { return 0; diff --git a/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp b/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp index 12086ad21cb92afe149d14380b92a504f2fc3727..af4ea53d9237a3aff12e520b3f43b83e8264e36f 100644 --- a/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_mgr_proxy_test.cpp @@ -1340,4 +1340,26 @@ HWTEST_F(SystemAbilityMgrProxyTest, GetLruIdleSystemAbilityProc002, TestSize.Lev EXPECT_NE(res, ERR_OK); } +HWTEST_F(SystemAbilityMgrProxyTest, UnloadProcess002, TestSize.Level3) +{ + DTEST_LOG << " UnloadProcess002 begin " << std::endl; + sptr samgrMock = new ISystemAbilityManagerMock; + EXPECT_TRUE(samgrMock != nullptr); + std::vector processList; + int32_t ret = samgrMock->UnloadProcess(processList); + EXPECT_TRUE(ret == 0); + DTEST_LOG << " UnloadProcess002 end " << std::endl; +} + +HWTEST_F(SystemAbilityMgrProxyTest, GetLruIdleSystemAbilityProc003, TestSize.Level3) +{ + DTEST_LOG << " GetLruIdleSystemAbilityProc003 begin " << std::endl; + sptr samgrMock = new ISystemAbilityManagerMock; + EXPECT_TRUE(samgrMock != nullptr); + std::vector processInfos; + int32_t ret = samgrMock->GetLruIdleSystemAbilityProc(processInfos); + EXPECT_TRUE(ret == 0); + DTEST_LOG << " GetLruIdleSystemAbilityProc003 end " << std::endl; +} + } \ No newline at end of file