diff --git a/frameworks/ans/test/unittest/notification_do_not_disturb_profile_test.cpp b/frameworks/ans/test/unittest/notification_do_not_disturb_profile_test.cpp index 0212181c0d7469bdd7b98219e0cc1397ea47dc9b..27a74851633faf3d25ed11a050dfbb9ae6a856bd 100644 --- a/frameworks/ans/test/unittest/notification_do_not_disturb_profile_test.cpp +++ b/frameworks/ans/test/unittest/notification_do_not_disturb_profile_test.cpp @@ -109,28 +109,6 @@ HWTEST_F(NotificationDoNotDisturbProfileTest, Marshalling_0100, TestSize.Level1) EXPECT_EQ(res, true); } -/** - * @tc.name: ReadFromParcel_0100 - * @tc.desc: test it when trustlist_ emplace success. - * @tc.type: FUNC - */ -HWTEST_F(NotificationDoNotDisturbProfileTest, ReadFromParcel_0100, TestSize.Level1) -{ - int32_t id = 1; - std::string name = "name"; - std::vector trustlist; - NotificationBundleOption bundleOption; - trustlist.emplace_back(bundleOption); - auto rrc = std::make_shared(id, name, trustlist); - - Parcel parcel; - parcel.WriteUint32(10); - auto res = rrc->ReadFromParcel(parcel); - sptr notification = new (std::nothrow) NotificationBundleOption(); - parcel.WriteParcelable(notification); - EXPECT_EQ(res, true); -} - /** * @tc.name: ReadFromParcel_0200 * @tc.desc: test it when trustlist_ emplace success. diff --git a/frameworks/ans/test/unittest/notification_test.cpp b/frameworks/ans/test/unittest/notification_test.cpp index 17937fcd66451b3dea1a008f19bbde6117a6f254..7346ad2392d2a7a5f568e55f9b9235d5e0bce224 100644 --- a/frameworks/ans/test/unittest/notification_test.cpp +++ b/frameworks/ans/test/unittest/notification_test.cpp @@ -323,8 +323,7 @@ HWTEST_F(NotificationTest, Dump_00001, Function | SmallTest | Level1) "notificationBundleOption = null, agentBundle = null, creatorUserId = -1, ownerUserId = -1, " "receiverUserId = -1, updateDeadLine = 0, finishDeadLine = 0, sound = , distributed = 0: " "flag: 0, unifiedGroupInfo_ = null }, postTime = 0, " - "sound = nullptr, vibrationStyle = [], updateTimer = 0, finishTimer = 0, archiveTimer = 0, " - "isPrivileged = false }"; + "sound = nullptr, vibrationStyle = [], updateTimer = 0, finishTimer = 0, archiveTimer = 0 }"; EXPECT_EQ(rrc->Dump(), ret); } diff --git a/services/ans/test/unittest/advanced_notification_service_test.cpp b/services/ans/test/unittest/advanced_notification_service_test.cpp index e1ac5d5cda715defaca83d400364b8818c0b1d09..6379db5e5be5ec060760d78dfe05386d58551a33 100644 --- a/services/ans/test/unittest/advanced_notification_service_test.cpp +++ b/services/ans/test/unittest/advanced_notification_service_test.cpp @@ -2202,7 +2202,7 @@ HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_22100, HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_22500, Function | SmallTest | Level1) { GTEST_LOG_(INFO) << "PushCheck_0100 test start"; - + MockIsVerfyPermisson(false); sptr req = new (std::nothrow) NotificationRequest(); ASSERT_EQ(advancedNotificationService_->PushCheck(req), ERR_ANS_PUSH_CHECK_UNREGISTERED); diff --git a/services/ans/test/unittest/notification_preferences_test.cpp b/services/ans/test/unittest/notification_preferences_test.cpp index a4ffc4433a7c725daa91569a3c09e1c4f00f2138..67944f396461338de14d97588e3ac004b8517017 100644 --- a/services/ans/test/unittest/notification_preferences_test.cpp +++ b/services/ans/test/unittest/notification_preferences_test.cpp @@ -1398,7 +1398,7 @@ HWTEST_F(NotificationPreferencesTest, AddDoNotDisturbProfiles_0100, TestSize.Lev profile->SetProfileId(0); profiles.emplace_back(profile); auto res = NotificationPreferences::GetInstance()->AddDoNotDisturbProfiles(userId, profiles); - ASSERT_EQ(res, ERR_ANS_INVALID_PARAM); + ASSERT_EQ(res, ERR_OK); } /** @@ -1444,7 +1444,7 @@ HWTEST_F(NotificationPreferencesTest, RemoveDoNotDisturbProfiles_0100, TestSize. profile->SetProfileId(0); profiles.emplace_back(profile); auto res = NotificationPreferences::GetInstance()->RemoveDoNotDisturbProfiles(userId, profiles); - ASSERT_EQ(res, ERR_ANS_INVALID_PARAM); + ASSERT_EQ(res, ERR_OK); } /** @@ -1478,20 +1478,6 @@ HWTEST_F(NotificationPreferencesTest, RemoveDoNotDisturbProfiles_0300, TestSize. ASSERT_EQ(res, ERR_OK); } -/** - * @tc.name: GetDoNotDisturbProfile_0100 - * @tc.desc: test GetDoNotDisturbProfile when profileId Not within the correct range. - * @tc.type: FUNC - */ -HWTEST_F(NotificationPreferencesTest, GetDoNotDisturbProfile_0100, TestSize.Level1) -{ - int32_t profileId = 0; - int32_t userId = 1; - sptr profile; - auto res = NotificationPreferences::GetInstance()->GetDoNotDisturbProfile(profileId, userId, profile); - ASSERT_EQ(res, ERR_ANS_INVALID_PARAM); -} - /** * @tc.name: GetDoNotDisturbProfile_0200 * @tc.desc: test GetDoNotDisturbProfile when GetDoNotDisturbProfiles of preferncesDB_ return false. @@ -1747,7 +1733,7 @@ HWTEST_F(NotificationPreferencesTest, UpdateDoNotDisturbProfiles_00200, Function auto res = NotificationPreferences::GetInstance()->UpdateDoNotDisturbProfiles( userId, profileId, name, bundleList); - ASSERT_EQ(res, ERR_ANS_INVALID_PARAM); + ASSERT_EQ(res, ERR_OK); } /**