!171 fix:修改告警:无符号数与小于0作比较

Merge pull request !171 from 李天刚/master
This commit is contained in:
openharmony_ci
2024-02-23 09:33:19 +00:00
committed by Gitee
2 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -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<std::string> &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);};
+8 -1
View File
@@ -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<std::string> dhids;
std::string ret = JointDhIds(dhids);
EXPECT_EQ("", ret);
}
} // namespace DistributedInput
} // namespace DistributedHardware
} // namespace OHOS