From 027be085b3adc9261907b3a62ac428e65114fe34 Mon Sep 17 00:00:00 2001 From: songbao1 Date: Fri, 11 Apr 2025 16:08:28 +0800 Subject: [PATCH] =?UTF-8?q?tdd=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: songbao1 --- .../advanced_notification_service_test.cpp | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/services/ans/test/unittest/advanced_notification_service_test.cpp b/services/ans/test/unittest/advanced_notification_service_test.cpp index e33717a07..65738f8e4 100644 --- a/services/ans/test/unittest/advanced_notification_service_test.cpp +++ b/services/ans/test/unittest/advanced_notification_service_test.cpp @@ -887,34 +887,6 @@ HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_10600, ASSERT_EQ(result->GetEndDate(), 0); } -/** - * @tc.number : AdvancedNotificationServiceTest_10700 - * @tc.name : ANS_GetDisturbMode_10700 - * @tc.desc : Test GetDisturbMode function - */ -HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_10700, Function | SmallTest | Level1) -{ - std::chrono::system_clock::time_point timePoint = std::chrono::system_clock::now(); - timePoint = std::chrono::time_point_cast(timePoint); - timePoint += std::chrono::hours(1); - auto beginDuration = std::chrono::duration_cast(timePoint.time_since_epoch()); - int64_t beginDate = beginDuration.count(); - timePoint += std::chrono::hours(1); - auto endDuration = std::chrono::duration_cast(timePoint.time_since_epoch()); - int64_t endDate = endDuration.count(); - - sptr date = - new NotificationDoNotDisturbDate(NotificationConstant::DoNotDisturbType::ONCE, beginDate, endDate); - ASSERT_EQ((int)advancedNotificationService_->SetDoNotDisturbDate(date), (int)ERR_OK); - - sptr result = nullptr; - ASSERT_EQ((int)advancedNotificationService_->GetDoNotDisturbDate(result), (int)ERR_OK); - ASSERT_NE(result, nullptr); - ASSERT_EQ(result->GetDoNotDisturbType(), NotificationConstant::DoNotDisturbType::ONCE); - ASSERT_EQ(result->GetBeginDate(), beginDate); - ASSERT_EQ(result->GetEndDate(), endDate); -} - /** * @tc.number : AdvancedNotificationServiceTest_10800 * @tc.name : ANS_GetDisturbMode_10800 @@ -943,34 +915,6 @@ HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_10800, ASSERT_EQ(result->GetEndDate(), endDate); } -/** - * @tc.number : AdvancedNotificationServiceTest_10900 - * @tc.name : ANS_GetDisturbMode_10900 - * @tc.desc : Test GetDisturbMode function - */ -HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_10900, Function | SmallTest | Level1) -{ - std::chrono::system_clock::time_point timePoint = std::chrono::system_clock::now(); - timePoint = std::chrono::time_point_cast(timePoint); - timePoint += std::chrono::hours(1); - auto beginDuration = std::chrono::duration_cast(timePoint.time_since_epoch()); - int64_t beginDate = beginDuration.count(); - timePoint += std::chrono::hours(1); - auto endDuration = std::chrono::duration_cast(timePoint.time_since_epoch()); - int64_t endDate = endDuration.count(); - - sptr date = - new NotificationDoNotDisturbDate(NotificationConstant::DoNotDisturbType::CLEARLY, beginDate, endDate); - ASSERT_EQ((int)advancedNotificationService_->SetDoNotDisturbDate(date), (int)ERR_OK); - - sptr result = nullptr; - ASSERT_EQ((int)advancedNotificationService_->GetDoNotDisturbDate(result), (int)ERR_OK); - ASSERT_NE(result, nullptr); - ASSERT_EQ(result->GetDoNotDisturbType(), NotificationConstant::DoNotDisturbType::CLEARLY); - ASSERT_EQ(result->GetBeginDate(), beginDate); - ASSERT_EQ(result->GetEndDate(), endDate); -} - /** * @tc.number : AdvancedNotificationServiceTest_12900 * @tc.name : ANS_HasNotificationPolicyAccessPermission_0100 -- Gitee