From 1f5d4911bef3a029c6f36b95c12831833b414d6a Mon Sep 17 00:00:00 2001 From: Yu Date: Wed, 21 Sep 2022 17:06:35 +0800 Subject: [PATCH] Fix codecheck problems of notification Signed-off-by: yuyaozhi --- frameworks/ans/src/notification.cpp | 2 +- .../ans_innerkits_module_publish_test.cpp | 20 +++++++++---------- .../notification_publish_test.cpp | 2 +- .../notification_service_test.cpp | 2 +- tools/dump/src/notification_shell_command.cpp | 1 - 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/frameworks/ans/src/notification.cpp b/frameworks/ans/src/notification.cpp index 7723258b8..352c4cc17 100644 --- a/frameworks/ans/src/notification.cpp +++ b/frameworks/ans/src/notification.cpp @@ -465,7 +465,7 @@ void Notification::SetRemindType(const NotificationConstant::RemindType &reminTy std::string Notification::GenerateNotificationKey( const std::string &deviceId, int32_t userId, int32_t uid, const std::string &label, int32_t id) { - const char *KEY_SPLITER = "_"; + const char *keySpliter = "_"; std::stringstream stream; stream << deviceId << KEY_SPLITER << userId << KEY_SPLITER << uid << KEY_SPLITER << label << KEY_SPLITER << id; diff --git a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp index a9e2e45a4..22de02b1b 100644 --- a/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp +++ b/frameworks/test/moduletest/ans_innerkits_module_publish_test.cpp @@ -74,40 +74,40 @@ const std::string CLASSIFICATION_ALARM {"alarm"}; class TestAnsSubscriber : public NotificationSubscriber { public: - virtual void OnConnected() override + void OnConnected() override { g_subscribe_mtx.unlock(); } - virtual void OnDisconnected() override + void OnDisconnected() override { g_unsubscribe_mtx.unlock(); } - virtual void OnDied() override + void OnDied() override {} - virtual void OnUpdate(const std::shared_ptr &sortingMap) override + void OnUpdate(const std::shared_ptr &sortingMap) override {} - virtual void OnDoNotDisturbDateChange(const std::shared_ptr &date) override + void OnDoNotDisturbDateChange(const std::shared_ptr &date) override {} - virtual void OnEnabledNotificationChanged( + void OnEnabledNotificationChanged( const std::shared_ptr &callbackData) override {} - virtual void OnCanceled(const std::shared_ptr &request) override + void OnCanceled(const std::shared_ptr &request) override { GTEST_LOG_(INFO) << "ANS_Interface_MT::OnCanceled request : " << request->GetNotificationRequest().Dump(); OnCanceledReceived = true; } - virtual void OnCanceled(const std::shared_ptr &request, + void OnCanceled(const std::shared_ptr &request, const std::shared_ptr &sortingMap, int deleteReason) override {} - virtual void OnConsumed(const std::shared_ptr &request) override + void OnConsumed(const std::shared_ptr &request) override { OnConsumedReceived = true; g_consumed_mtx.unlock(); @@ -153,7 +153,7 @@ public: } } - virtual void OnConsumed(const std::shared_ptr &request, + void OnConsumed(const std::shared_ptr &request, const std::shared_ptr &sortingMap) override {} diff --git a/test/bechmarktest/notification_publish_test/notification_publish_test.cpp b/test/bechmarktest/notification_publish_test/notification_publish_test.cpp index 02a348580..61b59db63 100644 --- a/test/bechmarktest/notification_publish_test/notification_publish_test.cpp +++ b/test/bechmarktest/notification_publish_test/notification_publish_test.cpp @@ -42,7 +42,7 @@ public: InitButtonRequest(); } - virtual ~BenchmarkNotificationPublish() override = default; + ~BenchmarkNotificationPublish() override = default; void SetUp(const ::benchmark::State &state) override {} diff --git a/test/bechmarktest/notification_services_test/notification_service_test.cpp b/test/bechmarktest/notification_services_test/notification_service_test.cpp index 0f3c6001e..25c853c36 100644 --- a/test/bechmarktest/notification_services_test/notification_service_test.cpp +++ b/test/bechmarktest/notification_services_test/notification_service_test.cpp @@ -68,7 +68,7 @@ public: ReportAggregatesOnly(); } - virtual ~BenchmarkNotificationService() override = default; + ~BenchmarkNotificationService() override = default; void SetUp(const ::benchmark::State &state) override {} diff --git a/tools/dump/src/notification_shell_command.cpp b/tools/dump/src/notification_shell_command.cpp index b135c15c5..0906e4684 100644 --- a/tools/dump/src/notification_shell_command.cpp +++ b/tools/dump/src/notification_shell_command.cpp @@ -305,7 +305,6 @@ ErrCode NotificationShellCommand::RunSetEnableCmd() resultReceiver_.append("set notification enabled failed\n"); } return ret; - } } // namespace Notification } // namespace OHOS -- Gitee