From 908e00082aee18701efa8d1f81978c4ca1c78c2d Mon Sep 17 00:00:00 2001 From: wangyb0625 Date: Thu, 28 Apr 2022 20:25:58 +0800 Subject: [PATCH 1/2] codex Signed-off-by: wangyb0625 --- .../include/dependency/timer/dm_timer.h | 2 +- .../src/dependency/timer/dm_timer.cpp | 2 +- test/unittest/UTTest_device_manager_impl.cpp | 2 +- test/unittest/UTTest_device_manager_notify.cpp | 2 +- test/unittest/UTTest_ipc_cmd_register.cpp | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/services/devicemanagerservice/include/dependency/timer/dm_timer.h b/services/devicemanagerservice/include/dependency/timer/dm_timer.h index 63822d477..eafdd5325 100644 --- a/services/devicemanagerservice/include/dependency/timer/dm_timer.h +++ b/services/devicemanagerservice/include/dependency/timer/dm_timer.h @@ -37,7 +37,7 @@ public: bool isTrigger = false; std::string timerName_; time_t expire_; - TimeoutHandle mHandle_;; + TimeoutHandle mHandle_; }; class TimeHeap { diff --git a/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp b/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp index b8b0c8c6b..5594ec6d7 100644 --- a/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp +++ b/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp @@ -56,7 +56,7 @@ int32_t TimeHeap::MoveUp(std::shared_ptr timer) return DM_INVALID_VALUE; } - for (int32_t i = 1;; i++) { + for (int32_t i = 1; i++) { LOGE("MoveUp 1 = %d, h = %d", i, hsize_); if (i == hsize_) { minHeap_.insert(minHeap_.begin() + (i - 1), timer); diff --git a/test/unittest/UTTest_device_manager_impl.cpp b/test/unittest/UTTest_device_manager_impl.cpp index d17c7b27a..d8a35712d 100644 --- a/test/unittest/UTTest_device_manager_impl.cpp +++ b/test/unittest/UTTest_device_manager_impl.cpp @@ -160,7 +160,7 @@ HWTEST_F(DeviceManagerImplTest, InitDeviceManager_005, testing::ext::TestSize.Le { // 1. call DeviceManagerImpl::InitDeviceManager with packName not null, dmInitCallback = nullprt std::string packName = ""; - std::shared_ptr callback = std::make_shared();; + std::shared_ptr callback = std::make_shared(); int32_t ret= DeviceManager::GetInstance().InitDeviceManager(packName, callback); // 2. check ret is DM_INVALID_VALUE ASSERT_EQ(ret, DM_INVALID_VALUE); diff --git a/test/unittest/UTTest_device_manager_notify.cpp b/test/unittest/UTTest_device_manager_notify.cpp index feaf58f96..de2bd6cd4 100644 --- a/test/unittest/UTTest_device_manager_notify.cpp +++ b/test/unittest/UTTest_device_manager_notify.cpp @@ -1738,7 +1738,7 @@ HWTEST_F(DeviceManagerNotifyTest, UnRegisterPackageCallback_003, testing::ext::T // call checkMap2 OnDeviceFound checkMap2->OnDeviceFound(subscribeId, deviceInfo); // call checkMap3 OnAuthResult - std::string token ="1";; + std::string token ="1"; int32_t status = 1; int32_t reason = 1; checkMap3->OnAuthResult(deviceId, token, status, reason); diff --git a/test/unittest/UTTest_ipc_cmd_register.cpp b/test/unittest/UTTest_ipc_cmd_register.cpp index 04e6a0b14..8c029ac7b 100644 --- a/test/unittest/UTTest_ipc_cmd_register.cpp +++ b/test/unittest/UTTest_ipc_cmd_register.cpp @@ -233,7 +233,7 @@ HWTEST_F(IpcCmdRegisterTest, ReadResponse_002, testing::ext::TestSize.Level0) std::shared_ptr rsp = std::make_shared(); // 2. call IpcCmdRegister OnRemoteRequest with parameter int ret = 0; - ret = IpcCmdRegister::GetInstance().ReadResponse(cmdCode, reply, rsp);; + ret = IpcCmdRegister::GetInstance().ReadResponse(cmdCode, reply, rsp); // 3. check ret is DM_OK ASSERT_EQ(ret, DM_OK); } @@ -258,7 +258,7 @@ HWTEST_F(IpcCmdRegisterTest, ReadResponse_003, testing::ext::TestSize.Level0) std::shared_ptr rsp = std::make_shared(); // 2. call IpcCmdRegister OnRemoteRequest with parameter int ret = 0; - ret = IpcCmdRegister::GetInstance().ReadResponse(cmdCode, reply, rsp);; + ret = IpcCmdRegister::GetInstance().ReadResponse(cmdCode, reply, rsp); // 3. check ret is DM_OK ASSERT_EQ(ret, DM_OK); } @@ -283,7 +283,7 @@ HWTEST_F(IpcCmdRegisterTest, ReadResponse_004, testing::ext::TestSize.Level0) std::shared_ptr rsp = std::make_shared(); // 2. call IpcCmdRegister OnRemoteRequest with parameter int ret = 0; - ret = IpcCmdRegister::GetInstance().ReadResponse(cmdCode, reply, rsp);; + ret = IpcCmdRegister::GetInstance().ReadResponse(cmdCode, reply, rsp); // 3. check ret is DM_OK ASSERT_EQ(ret, DM_OK); } @@ -312,7 +312,7 @@ HWTEST_F(IpcCmdRegisterTest, ReadResponse_005, testing::ext::TestSize.Level0) std::shared_ptr rsp = std::make_shared(); // 2. call IpcCmdRegister OnRemoteRequest with parameter int ret = 0; - ret = IpcCmdRegister::GetInstance().ReadResponse(cmdCode, reply, rsp);; + ret = IpcCmdRegister::GetInstance().ReadResponse(cmdCode, reply, rsp); // 3. check ret is DM_IPC_TRANSACTION_FAILED ASSERT_EQ(ret, DM_IPC_TRANSACTION_FAILED); } -- Gitee From f0b9e86d4589c429c669372c2fec999fd0c9a9e6 Mon Sep 17 00:00:00 2001 From: wangyb0625 Date: Thu, 28 Apr 2022 21:33:39 +0800 Subject: [PATCH 2/2] 1 Signed-off-by: wangyb0625 --- services/devicemanagerservice/src/dependency/timer/dm_timer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp b/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp index 5594ec6d7..b8b0c8c6b 100644 --- a/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp +++ b/services/devicemanagerservice/src/dependency/timer/dm_timer.cpp @@ -56,7 +56,7 @@ int32_t TimeHeap::MoveUp(std::shared_ptr timer) return DM_INVALID_VALUE; } - for (int32_t i = 1; i++) { + for (int32_t i = 1;; i++) { LOGE("MoveUp 1 = %d, h = %d", i, hsize_); if (i == hsize_) { minHeap_.insert(minHeap_.begin() + (i - 1), timer); -- Gitee