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/ans_manager_stub_test.cpp b/services/ans/test/unittest/ans_manager_stub_test.cpp index 05348cfbf320d98ec943c4136cc4b6453ebd6e9b..c9007eb8546c72633da0bf9b26fa038f88dd0093 100644 --- a/services/ans/test/unittest/ans_manager_stub_test.cpp +++ b/services/ans/test/unittest/ans_manager_stub_test.cpp @@ -1090,25 +1090,6 @@ HWTEST_F(AnsManagerStubTest, HandleSetDoNotDisturbDate01, Function | SmallTest | EXPECT_EQ(ret, (int)NO_ERROR); } -/** - * @tc.name: HandleSetDoNotDisturbDate02 - * @tc.desc: Test if the date in data is null.. - * @tc.type: FUNC - * @tc.require: issueI5XQ4E - */ -HWTEST_F(AnsManagerStubTest, HandleSetDoNotDisturbDate02, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(NotificationInterfaceCode::SET_DO_NOT_DISTURB_DATE); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - /** * @tc.name: HandleGetDoNotDisturbDate01 * @tc.desc: Test HandleGetDoNotDisturbDate succeeds. @@ -2146,50 +2127,6 @@ HWTEST_F(AnsManagerStubTest, HandleSetShowBadgeEnabledForBundle03, Function | Sm EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); } -/** - * @tc.name: HandleAddSlots01 - * @tc.desc: Test if the slots in data is null. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, HandleAddSlots01, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(NotificationInterfaceCode::ADD_SLOTS); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - -/** - * @tc.name: HandleAddSlots02 - * @tc.desc: Test if the result in data is null. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, HandleAddSlots02, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(NotificationInterfaceCode::ADD_SLOTS); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - std::vector> slots; - sptr slot = new NotificationSlot(); - slots.emplace_back(slot); - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - ErrCode result = ansManagerStub_->AddSlots(slots); - ansManagerStub_->WriteParcelableVector(slots, reply, result); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - /** * @tc.name: HandleGetSlots01 * @tc.desc: Test HandleGetSlots succeed. @@ -3320,50 +3257,6 @@ HWTEST_F(AnsManagerStubTest, HandleSetDoNotDisturbDateByUser01, Function | Small EXPECT_EQ(ret, (int)ERR_OK); } -/** - * @tc.name: HandleSetDoNotDisturbDateByUser02 - * @tc.desc: Test userId in data is null. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, HandleSetDoNotDisturbDateByUser02, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(NotificationInterfaceCode::SET_DO_NOT_DISTURB_DATE_BY_USER); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - sptr date = new NotificationDoNotDisturbDate(); - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - data.WriteParcelable(date); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - -/** - * @tc.name: HandleSetDoNotDisturbDateByUser03 - * @tc.desc: Test date in data is null. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, HandleSetDoNotDisturbDateByUser03, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(NotificationInterfaceCode::SET_DO_NOT_DISTURB_DATE_BY_USER); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - int32_t userId = 4; - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - data.WriteInt32(userId); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - /** * @tc.name: HandleGetDoNotDisturbDateByUser01 * @tc.desc: Test HandleGetDoNotDisturbDateByUser succeed. @@ -3437,78 +3330,6 @@ HWTEST_F(AnsManagerStubTest, HandleSetEnabledForBundleSlot01, Function | SmallTe EXPECT_EQ(ret, (int)ERR_OK); } -/** - * @tc.name: HandleSetEnabledForBundleSlot02 - * @tc.desc: Test bundleOption in data is null. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, HandleSetEnabledForBundleSlot02, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(NotificationInterfaceCode::SET_ENABLED_FOR_BUNDLE_SLOT); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - int32_t type = 4; - bool enabled = true; - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - data.WriteInt32(type); - data.WriteBool(enabled); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - -/** - * @tc.name: HandleSetEnabledForBundleSlot03 - * @tc.desc: Test type in data is null. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, HandleSetEnabledForBundleSlot03, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(NotificationInterfaceCode::SET_ENABLED_FOR_BUNDLE_SLOT); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - sptr bundleOption = new NotificationBundleOption(); - bool enabled = true; - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - data.WriteStrongParcelable(bundleOption); - data.WriteBool(enabled); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - -/** - * @tc.name: HandleSetEnabledForBundleSlot04 - * @tc.desc: Test enabled in data is null. - * @tc.type: FUNC - * @tc.require: issueI620XB - */ -HWTEST_F(AnsManagerStubTest, HandleSetEnabledForBundleSlot04, Function | SmallTest | Level1) -{ - uint32_t code = static_cast(NotificationInterfaceCode::SET_ENABLED_FOR_BUNDLE_SLOT); - MessageParcel data; - MessageParcel reply; - MessageOption option = {MessageOption::TF_SYNC}; - - sptr bundleOption = new NotificationBundleOption(); - int32_t type = 4; - - data.WriteInterfaceToken(AnsManagerStub::GetDescriptor()); - data.WriteStrongParcelable(bundleOption); - data.WriteInt32(type); - - ErrCode ret = ansManagerStub_->OnRemoteRequest(code, data, reply, option); - EXPECT_EQ(ret, (int)ERR_ANS_PARCELABLE_FAILED); -} - /** * @tc.name: HandleGetEnabledForBundleSlot01 * @tc.desc: Test HandleGetEnabledForBundleSlot succeed.