codecheck and UT

Signed-off-by: MisterE <smart_e@126.com>
This commit is contained in:
MisterE 2024-10-25 17:48:55 +08:00
commit 98d74d5fb6
2 changed files with 30 additions and 2 deletions

View File

@ -367,8 +367,8 @@ int32_t DMSContinueRecvMgr::DealOnBroadcastBusiness(const std::string& senderNet
return ERR_OK;
}
bool DMSContinueRecvMgr::IsBundleContinuable(const AppExecFwk::BundleInfo& bundleInfo, const std::string &srcAbilityName,
const std::string &srcContinueType, bool isSameBundle)
bool DMSContinueRecvMgr::IsBundleContinuable(const AppExecFwk::BundleInfo& bundleInfo,
const std::string &srcAbilityName, const std::string &srcContinueType, bool isSameBundle)
{
std::string formatSrcContinueType = ContinueTypeFormat(srcContinueType);
bool continuable = false;

View File

@ -970,6 +970,34 @@ HWTEST_F(DMSContinueManagerTest, testGetFinalBundleName_001, TestSize.Level1)
DTEST_LOG << "DMSContinueManagerTest testGetFinalBundleName_001 end" << std::endl;
}
/**
* @tc.name: testGetFinalBundleName_001
* @tc.desc: test GetFinalBundleName
* @tc.type: FUNC
*/
HWTEST_F(DMSContinueManagerTest, testIsBundleContinuable_001, TestSize.Level1)
{
DTEST_LOG << "DMSContinueManagerTest testIsBundleContinuable_001 start" << std::endl;
std::string srcAbilityName = "abilityName";
std::string srcContinueType = "continueType";
AppExecFwk::BundleInfo localBundleInfo;
std::vector<AbilityInfo> abilityInfos;
AbilityInfo abilityInfo;
std::vector<std::string> continueTypes;
continueTypes.push_back(srcContinueType);
abilityInfo.continueType = continueTypes;
abilityInfo.continuable = true;
abilityInfo.name = srcAbilityName;
abilityInfos.push_back(abilityInfo);
localBundleInfo.abilityInfo = abilityInfos;
bool ret = DMSContinueRecvMgr::GetInstance().IsBundleContinuable(localBundleInfo, srcAbilityName,
srcContinueType, true);
EXPECT_EQ(ret, true);
DTEST_LOG << "DMSContinueManagerTest testIsBundleContinuable_001 end" << std::endl;
}
/**
* @tc.name: GetBundleNameByScreenOffInfo_001
* @tc.desc: test GetBundleNameByScreenOffInfo