diff --git a/frameworks/ans/test/unittest/notification_capsule_test.cpp b/frameworks/ans/test/unittest/notification_capsule_test.cpp index 350f6d2161b67268c671810c62e00f4dd845a9af..a21e8cdcf35a6c729fb1c4d06171d0fe21bfc0ce 100644 --- a/frameworks/ans/test/unittest/notification_capsule_test.cpp +++ b/frameworks/ans/test/unittest/notification_capsule_test.cpp @@ -129,6 +129,7 @@ HWTEST_F(NotificationCapsuleTest, Unmarshalling_00001, Function | SmallTest | Le Parcel parcel; std::shared_ptr result = std::make_shared(); + result->Marshalling(parcel); if (nullptr != result) { if (nullptr == result->Unmarshalling(parcel)) { diff --git a/frameworks/ans/test/unittest/notification_request_test.cpp b/frameworks/ans/test/unittest/notification_request_test.cpp index b8ea1c84af66d7ab3b2f54911fec17924dfc7ca6..65c7ddcb287805f62f7608d967931366784f9025 100644 --- a/frameworks/ans/test/unittest/notification_request_test.cpp +++ b/frameworks/ans/test/unittest/notification_request_test.cpp @@ -956,7 +956,7 @@ HWTEST_F(NotificationRequestTest, GetNotificationRequestKey_0001, Level1) notificationRequest.SetLabel(string("test")); notificationRequest.SetCreatorBundleName(string("push.com")); auto key = notificationRequest.GetKey(); - string expectKey {"ans_live_view__1_0_push.com_test_10"}; + string expectKey {"ans_live_view___1_0_push.com_test_10"}; EXPECT_EQ(key, expectKey); } @@ -976,7 +976,7 @@ HWTEST_F(NotificationRequestTest, GetNotificationRequestKey_0002, Level1) notificationRequest.SetOwnerBundleName(string("test.com")); notificationRequest.SetIsAgentNotification(true); auto key = notificationRequest.GetKey(); - string expectKey {"ans_live_view__1_2_test.com_test_10"}; + string expectKey {"ans_live_view___1_2_test.com_test_10"}; EXPECT_EQ(key, expectKey); } diff --git a/frameworks/ans/test/unittest/notification_subscribe_info_test.cpp b/frameworks/ans/test/unittest/notification_subscribe_info_test.cpp index d01af4692ae3e3ac196710b12afe264fc5ab98d5..3ef984874bb97ef9603e74fe75b0e145c0c5682c 100644 --- a/frameworks/ans/test/unittest/notification_subscribe_info_test.cpp +++ b/frameworks/ans/test/unittest/notification_subscribe_info_test.cpp @@ -167,7 +167,7 @@ HWTEST_F(NotificationSubscribeInfoTest, Dump_00001, Function | SmallTest | Level "appNames = [" + appName + ", ]" + "deviceType = " + deviceType + "userId = " + std::to_string(userId) + - "slotTypes = []filterType = 0 }"; + "slotTypes = []filterType = 0needResponse = 0 }"; EXPECT_EQ(res, rrc->Dump()); } } diff --git a/frameworks/ans/test/unittest/notification_test.cpp b/frameworks/ans/test/unittest/notification_test.cpp index 6e0040ad835d62fcc5e2c3da3830a839d1b8bd28..7346ad2392d2a7a5f568e55f9b9235d5e0bce224 100644 --- a/frameworks/ans/test/unittest/notification_test.cpp +++ b/frameworks/ans/test/unittest/notification_test.cpp @@ -216,7 +216,7 @@ HWTEST_F(NotificationTest, GenerateNotificationKey_00001, Function | SmallTest | request->SetNotificationId(id); request->SetCreatorBundleName("come.test"); auto rrc = std::make_shared(request); - std::string result = "_10_20_come.test_Lable_30"; + std::string result = "__10_20_come.test_Lable_30"; EXPECT_EQ(rrc->GetKey(), result); } @@ -242,7 +242,7 @@ HWTEST_F(NotificationTest, GenerateNotificationKey_00002, Function | SmallTest | request->SetCreatorBundleName("come.push"); request->SetOwnerBundleName("come.test"); auto rrc = std::make_shared(deviceId, request); - std::string result = "DeviceId_10_20_come.test_Lable_30"; + std::string result = "_DeviceId_10_20_come.test_Lable_30"; EXPECT_EQ(rrc->GetKey(), result); } @@ -301,7 +301,7 @@ HWTEST_F(NotificationTest, Dump_00001, Function | SmallTest | Level1) std::string deviceId = "DeviceId"; sptr request = new NotificationRequest(); auto rrc = std::make_shared(deviceId, request); - std::string ret = "Notification{ key = DeviceId_-1_0___0, ledLightColor = 0, " + std::string ret = "Notification{ key = _DeviceId_-1_0___0, ledLightColor = 0, " "lockscreenVisbleness = 0, remindType = -1, isRemoveAllowed = true, sourceType = 0, " "deviceId = DeviceId, request = NotificationRequest{ notificationId = 0, slotType = 3, " "createTime = 0, deliveryTime = 0, autoDeletedTime = -1, settingsText = , " @@ -313,14 +313,16 @@ HWTEST_F(NotificationTest, Dump_00001, Function | SmallTest | Level1) "tapDismissed = true, colorEnabled = false, alertOneTime = false, showStopwatch = false, " "isCountdown = false, inProgress = false, groupOverview = false, isRemoveAllowed = true, " "progressIndeterminate = false, unremovable = false, floatingIcon = false, onlyLocal = false, " - "permitted = true, isAgent = false, updateOnly = false, removalWantAgent = null, maxScreenWantAgent = null, " + "permitted = true, isAgent = false, updateOnly = false, isForceDistributed = false, " + "isNotDistributed = false, removalWantAgent = null, maxScreenWantAgent = null, " "additionalParams = null, littleIcon = null, bigIcon = null, overlayIcon = null, " "notificationContent = null, notificationTemplate = null, actionButtons = empty, " "messageUsers = empty, userInputHistory = empty, distributedOptions = " "NotificationDistributedOptions{ isDistributed = true, devicesSupportDisplay = [], " "devicesSupportOperate = [] }, notificationFlags = null, notificationFlagsOfDevices = null, " "notificationBundleOption = null, agentBundle = null, creatorUserId = -1, ownerUserId = -1, " - "receiverUserId = -1, updateDeadLine = 0, finishDeadLine = 0, sound = , unifiedGroupInfo_ = null }, postTime = 0, " + "receiverUserId = -1, updateDeadLine = 0, finishDeadLine = 0, sound = , distributed = 0: " + "flag: 0, unifiedGroupInfo_ = null }, postTime = 0, " "sound = nullptr, vibrationStyle = [], updateTimer = 0, finishTimer = 0, archiveTimer = 0 }"; EXPECT_EQ(rrc->Dump(), ret); } diff --git a/services/ans/test/unittest/ans_manager_stub_test.cpp b/services/ans/test/unittest/ans_manager_stub_test.cpp index b3bff905598ae5bf9f938cae1b7fb49e02d162f6..600a7403e873a60e7bac3e02d0bc359f62bbe851 100644 --- a/services/ans/test/unittest/ans_manager_stub_test.cpp +++ b/services/ans/test/unittest/ans_manager_stub_test.cpp @@ -3432,7 +3432,7 @@ HWTEST_F(AnsManagerStubTest, HandleSetEnabledForBundleSlot01, Function | SmallTe data.WriteBool(isForceControl); ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); + EXPECT_EQ(ret, (int)ERR_ANS_INVALID_PARAM); } /** @@ -4893,7 +4893,7 @@ HWTEST_F(AnsManagerStubTest, HandleAddDoNotDisturbProfiles_0100, TestSize.Level1 MessageParcel data; MessageParcel reply; ErrCode ret = ansManagerStub_->HandleAddDoNotDisturbProfiles(data, reply); - EXPECT_EQ(ret, ERR_ANS_PARCELABLE_FAILED); + EXPECT_EQ(ret, ERR_OK); } /**