From 1123c84e1cbfbab229880e4faf20eb6de7d1292c Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Mon, 6 Jun 2022 09:13:27 +0800 Subject: [PATCH] ut modify Signed-off-by: fangJinliang1 Change-Id: Ic08474e863640e182b7f76d816ea3a12c0150b5b Signed-off-by: fangJinliang1 --- services/test/moduletest/ans_module_test.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/test/moduletest/ans_module_test.cpp b/services/test/moduletest/ans_module_test.cpp index 1a76cf30e..09bed0109 100644 --- a/services/test/moduletest/ans_module_test.cpp +++ b/services/test/moduletest/ans_module_test.cpp @@ -522,6 +522,9 @@ HWTEST_F(AnsModuleTest, AnsModuleTest_0017, Function | SmallTest | Level1) g_advancedNotificationService->Publish(label, req); EXPECT_TRUE(passed); g_advancedNotificationService->Unsubscribe(subscriber->GetImpl(), subscriberInfo); + + delete subscriber; + subscriber = nullptr; } /** @@ -1115,7 +1118,7 @@ HWTEST_F(AnsModuleTest, AnsModuleTest_0051, Function | SmallTest | Level1) slots.push_back(slot); g_advancedNotificationService->AddSlots(slots); - std::vector> slotsRef{}; + std::vector> slotsRe {}; g_advancedNotificationService->GetSlots(slotsRef); EXPECT_EQ(1, static_cast(slotsRef.size())); std::vector slotsId{}; @@ -1835,6 +1838,8 @@ HWTEST_F(AnsModuleTest, AnsModuleTest_0108, Function | SmallTest | Level1) g_advancedNotificationService->GetActiveNotificationNums(nums); EXPECT_EQ(nums, 0); g_advancedNotificationService->Unsubscribe(subscriber->GetImpl(), subscriberInfo); + delete subscriber; + subscriber = nullptr; } /** -- Gitee