!720 修改UT用例

Merge pull request !720 from 师皓杰/master
This commit is contained in:
openharmony_ci 2023-10-28 09:15:52 +00:00 committed by Gitee
commit 97ce78b7f6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 7 additions and 8 deletions

View File

@ -112,8 +112,7 @@ bool DstbMissionInfo::ReadDstbMissionInfosFromParcel(Parcel& parcel,
return false;
}
size_t size = static_cast<size_t>(len);
if ((size > Constants::Mission::GET_MAX_MISSIONS) || (size * sizeof(DstbMissionInfo) >
parcel.GetReadableBytes())) {
if (size > Constants::Mission::GET_MAX_MISSIONS) {
HILOGE("Failed to read DstbMissionInfo vector, size = %{public}zu", size);
return false;
}

View File

@ -142,7 +142,7 @@ HWTEST_F(BundleManagerInternalTest, BundleManagerInternalTest_005, TestSize.Leve
{
DTEST_LOG << "BundleManagerInternalTest BundleManagerInternalTest_005 begin" << std::endl;
string deviceId = "123456";
string bundleName = "com.third.hiworld.example";
string bundleName = "com.ohos.mms";
AppExecFwk::DistributedBundleInfo remoteBundleInfo;
int ret = BundleManagerInternal::CheckRemoteBundleInfoForContinuation(deviceId, bundleName, remoteBundleInfo);
EXPECT_TRUE(CONTINUE_REMOTE_UNINSTALLED_UNSUPPORT_FREEINSTALL == ret);
@ -159,7 +159,7 @@ HWTEST_F(BundleManagerInternalTest, BundleManagerInternalTest_006, TestSize.Leve
{
DTEST_LOG << "BundleManagerInternalTest BundleManagerInternalTest_006 begin" << std::endl;
string deviceId = "123456";
string bundleName = "com.third.hiworld.example";
string bundleName = "com.ohos.mms";
string moduleName = "entry";
string abilityName = "bmsThirdBundle";
AAFwk::Want want;

View File

@ -356,7 +356,7 @@ HWTEST_F(DSchedContinuationTest, SetWantForContinuation_002, TestSize.Level1)
* @tc.steps: step1. input valid bundleName.
* @tc.expected: step1. return OK.
*/
std::string bundleName = "com.third.hiworld.example";
std::string bundleName = "com.ohos.mms";
std::string abilityName = "bmsThirdBundle";
std::shared_ptr<Want> spWant = MockWant(bundleName, abilityName, 0);
int32_t missionId = 0;

View File

@ -60,8 +60,8 @@ namespace {
constexpr int32_t MISSION_ID = 1;
const std::string DMS_SRC_NETWORK_ID = "dmsSrcNetworkId";
const int DEFAULT_REQUEST_CODE = -1;
const string ABILITY_NAME = "com.ohos.launcher.MainAbility";
const string BUNDLE_NAME = "com.ohos.launcher";
const string ABILITY_NAME = "com.ohos.permissionmanager.MainAbility";
const string BUNDLE_NAME = "com.ohos.permissionmanager";
const string DMS_IS_CALLER_BACKGROUND = "dmsIsCallerBackGround";
const string DMS_VERSION_ID = "dmsVersion";
const string DMS_VERSION = "4.0.0";
@ -1934,7 +1934,7 @@ HWTEST_F(DistributedSchedServiceTest, StartLocalAbility_005, TestSize.Level3)
AAFwk::Want want;
std::string localDeviceId;
DtbschedmgrDeviceInfoStorage::GetInstance().GetLocalDeviceId(localDeviceId);
AppExecFwk::ElementName element(localDeviceId, "com.third.hiworld.example", "bmsThirdBundle");
AppExecFwk::ElementName element(localDeviceId, "com.ohos.mms", "bmsThirdBundle");
want.SetElement(element);
want.SetParam(DMS_IS_CALLER_BACKGROUND, false);
AppExecFwk::AbilityInfo abilityInfo;