clang-tidy: Enable readability-qualified-auto check
This check aims to improve code readability by suggesting the use
of const auto * instead of auto for variables that are pointers
or iterators. This helps clarify the const-ness of the pointed-to
object or container elements.
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Ia132b6dd8ae4e3c16809326f6055396666abc95a
diff --git a/.clang-tidy b/.clang-tidy
index 7a042f3..d0c304e 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -267,6 +267,7 @@
readability-misplaced-array-index,
readability-named-parameter,
readability-non-const-parameter,
+readability-qualified-auto,
readability-redundant-access-specifiers,
readability-redundant-function-ptr-dereference,
readability-redundant-member-init,
diff --git a/manager/manager.cpp b/manager/manager.cpp
index df65426..02ea6a5 100644
--- a/manager/manager.cpp
+++ b/manager/manager.cpp
@@ -46,7 +46,7 @@
std::map<LedName, Layout::LedAction> newState;
// update the new map with the desired state
- for (const auto it : sorted)
+ for (const auto* it : sorted)
{
// apply all led actions of that group to the map
for (const Layout::LedAction& action : it->actionSet)
diff --git a/test/utest-led-yaml-group-priority.cpp b/test/utest-led-yaml-group-priority.cpp
index b257c17..c31a788 100644
--- a/test/utest-led-yaml-group-priority.cpp
+++ b/test/utest-led-yaml-group-priority.cpp
@@ -29,7 +29,7 @@
EXPECT_EQ(group.priority, 1);
EXPECT_EQ(group.actionSet.size(), 1);
- for (auto& led : group.actionSet)
+ for (const auto& led : group.actionSet)
{
EXPECT_EQ(led.name, "led1");
EXPECT_EQ(led.action, Action::On);
@@ -47,7 +47,7 @@
EXPECT_EQ(group.priority, 2);
EXPECT_EQ(group.actionSet.size(), 1);
- for (auto& led : group.actionSet)
+ for (const auto& led : group.actionSet)
{
EXPECT_EQ(led.name, "led1");
EXPECT_EQ(led.action, Action::Off);
@@ -65,7 +65,7 @@
EXPECT_EQ(group.priority, 3);
EXPECT_EQ(group.actionSet.size(), 1);
- for (auto& led : group.actionSet)
+ for (const auto& led : group.actionSet)
{
EXPECT_EQ(led.name, "led1");
EXPECT_EQ(led.action, Action::Blink);
@@ -86,7 +86,7 @@
EXPECT_EQ(group.actionSet.size(), 2);
int found = 0;
- for (auto& led : group.actionSet)
+ for (const auto& led : group.actionSet)
{
if (led.name == "led1")
{
diff --git a/test/utest-led-yaml-led-priority.cpp b/test/utest-led-yaml-led-priority.cpp
index 4cee0f0..a432547 100644
--- a/test/utest-led-yaml-led-priority.cpp
+++ b/test/utest-led-yaml-led-priority.cpp
@@ -29,7 +29,7 @@
EXPECT_EQ(group.priority, 0);
EXPECT_EQ(group.actionSet.size(), 1);
- for (auto& led : group.actionSet)
+ for (const auto& led : group.actionSet)
{
EXPECT_EQ(led.name, "led1");
EXPECT_EQ(led.action, Action::On);
@@ -47,7 +47,7 @@
EXPECT_EQ(group.priority, 0);
EXPECT_EQ(group.actionSet.size(), 1);
- for (auto& led : group.actionSet)
+ for (const auto& led : group.actionSet)
{
EXPECT_EQ(led.name, "led2");
EXPECT_EQ(led.action, Action::Off);
@@ -65,7 +65,7 @@
EXPECT_EQ(group.priority, 0);
EXPECT_EQ(group.actionSet.size(), 1);
- for (auto& led : group.actionSet)
+ for (const auto& led : group.actionSet)
{
EXPECT_EQ(led.name, "led3");
EXPECT_EQ(led.action, Action::Blink);
diff --git a/test/utest-serialize.cpp b/test/utest-serialize.cpp
index 8c75031..7a7188b 100644
--- a/test/utest-serialize.cpp
+++ b/test/utest-serialize.cpp
@@ -10,11 +10,11 @@
{
namespace fs = std::filesystem;
- static constexpr auto& path = "config/led-save-group.json";
- static constexpr auto& bmcBooted =
+ static constexpr auto path = "config/led-save-group.json";
+ static constexpr auto bmcBooted =
"/xyz/openbmc_project/led/groups/bmc_booted";
- static constexpr auto& powerOn = "/xyz/openbmc_project/led/groups/power_on";
- static constexpr auto& enclosureIdentify =
+ static constexpr auto powerOn = "/xyz/openbmc_project/led/groups/power_on";
+ static constexpr auto enclosureIdentify =
"/xyz/openbmc_project/led/groups/EnclosureIdentify";
Serialize serialize(path);
diff --git a/test/utest.cpp b/test/utest.cpp
index 5f62f25..ea2eb83 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -28,7 +28,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/SingleLed";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -59,7 +60,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/SingleLed";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -90,7 +92,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/SingleLed";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -115,7 +118,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/SingleLed";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -134,7 +138,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -169,7 +174,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -204,7 +210,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -233,7 +240,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -268,7 +276,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -297,7 +306,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -326,7 +336,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -344,7 +355,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -383,7 +395,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -412,7 +425,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -447,7 +461,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -476,7 +491,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -510,7 +526,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -539,7 +556,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -567,7 +585,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -602,7 +621,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -631,7 +651,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -659,7 +680,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -706,7 +728,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -735,7 +758,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -764,7 +788,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -799,7 +824,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -828,7 +854,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -857,7 +884,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -904,7 +932,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -935,7 +964,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -960,7 +990,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -993,7 +1024,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1024,7 +1056,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1059,7 +1092,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1091,7 +1125,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1131,7 +1166,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1162,7 +1198,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1193,7 +1230,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -1234,7 +1272,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -1265,7 +1304,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -1287,7 +1327,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1320,7 +1361,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1352,7 +1394,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -1399,7 +1442,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1432,7 +1476,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1464,7 +1509,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -1510,7 +1556,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1543,7 +1590,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1586,7 +1634,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1619,7 +1668,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1651,7 +1701,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -1698,7 +1749,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1731,7 +1783,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, true, ledsAssert, ledsDeAssert);
EXPECT_EQ(true, result);
@@ -1763,7 +1816,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -1805,7 +1859,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);
@@ -1838,7 +1893,8 @@
ActionSet ledsAssert{};
ActionSet ledsDeAssert{};
- auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
+ static constexpr auto group =
+ "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
manager.setGroupState(group, false, ledsAssert, ledsDeAssert);
EXPECT_EQ(false, result);