diff --git a/utils/src/dinput_utils_tool.cpp b/utils/src/dinput_utils_tool.cpp index 6bf0655c93727a850ef0e2fa45c748a4a95a2444..f7136a4d57b51a28e500048b77b1424a0d454dd4 100644 --- a/utils/src/dinput_utils_tool.cpp +++ b/utils/src/dinput_utils_tool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -450,7 +450,7 @@ int32_t GetRandomInt32() std::string JointDhIds(const std::vector &dhids) { - if (dhids.size() <= 0) { + if (dhids.size() == 0) { return ""; } auto dotFold = [](std::string a, std::string b) {return std::move(a) + DHID_SPLIT + std::move(b);}; diff --git a/utils/test/unittest/dinput_context_test.cpp b/utils/test/unittest/dinput_context_test.cpp index 7c541d691cf2385dda698fee863ac3b071fb1368..7b3211d438f4f2f69f0d5e97c0b714fefd0beb39 100644 --- a/utils/test/unittest/dinput_context_test.cpp +++ b/utils/test/unittest/dinput_context_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -239,6 +239,13 @@ HWTEST_F(DInputContextTest, GetNodeDesc_001, testing::ext::TestSize.Level1) EXPECT_EQ(0, ret.size()); } +HWTEST_F(DInputContextTest, JointDhIds_001, testing::ext::TestSize.Level1) +{ + std::vector dhids; + std::string ret = JointDhIds(dhids); + EXPECT_EQ("", ret); +} + } // namespace DistributedInput } // namespace DistributedHardware } // namespace OHOS