led-layout: use common types everywhere
Rather than scattered map and set typedefs, centralize the two common
structures into 'ledlayout.hpp': ActionSet, GroupMap. Use them
everywhere where previous raw maps and sets were used.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I0ed5203146a6486a49caf4000f545ded0088dc15
diff --git a/manager/group.cpp b/manager/group.cpp
index 33c64f6..d728f2b 100644
--- a/manager/group.cpp
+++ b/manager/group.cpp
@@ -2,6 +2,8 @@
#include "group.hpp"
+#include "ledlayout.hpp"
+
#include <sdbusplus/message.hpp>
namespace phosphor
{
@@ -28,8 +30,8 @@
}
// Introducing these to enable gtest.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
// Group management is handled by Manager. The populated leds* sets are not
// really used by production code. They are there to enable gtest for
diff --git a/manager/json-parser.hpp b/manager/json-parser.hpp
index 06fb096..e8819ef 100644
--- a/manager/json-parser.hpp
+++ b/manager/json-parser.hpp
@@ -15,8 +15,6 @@
namespace fs = std::filesystem;
using Json = nlohmann::json;
-using LedAction = std::set<phosphor::led::Layout::LedAction>;
-using LedMap = std::unordered_map<std::string, LedAction>;
// Priority for a particular LED needs to stay SAME across all groups
// phosphor::led::Layout::Action can only be one of `Blink` and `On`
@@ -101,11 +99,11 @@
/** @brief Load JSON config and return led map (JSON version 1)
*
- * @return LedMap - Generated an std::unordered_map of LedAction
+ * @return phosphor::led::GroupMap
*/
-const LedMap loadJsonConfigV1(const Json& json)
+const phosphor::led::GroupMap loadJsonConfigV1(const Json& json)
{
- LedMap ledMap{};
+ phosphor::led::GroupMap ledMap{};
PriorityMap priorityMap{};
// define the default JSON as empty
@@ -119,7 +117,7 @@
auto objpath = tmpPath.string();
auto members = entry.value("members", empty);
- LedAction ledActions{};
+ phosphor::led::ActionSet ledActions{};
for (const auto& member : members)
{
auto name = member.value("Name", "");
@@ -149,9 +147,9 @@
/** @brief Load JSON config and return led map
*
- * @return LedMap - Generated an std::unordered_map of LedAction
+ * @return phosphor::led::GroupMap
*/
-const LedMap loadJsonConfig(const fs::path& path)
+const phosphor::led::GroupMap loadJsonConfig(const fs::path& path)
{
auto json = readJson(path);
@@ -167,18 +165,18 @@
throw std::runtime_error("Unsupported version");
}
- return LedMap{};
+ return phosphor::led::GroupMap{};
}
/** @brief Get led map from LED groups JSON config
*
* @param[in] config - Path to the JSON config.
- * @return LedMap - Generated an std::unordered_map of LedAction
+ * @return phosphor::led::GroupMap
*
* @note if config is an empty string, daemon will interrogate dbus for
* compatible strings.
*/
-const LedMap getSystemLedMap(fs::path config)
+const phosphor::led::GroupMap getSystemLedMap(fs::path config)
{
if (config.empty())
{
diff --git a/manager/lamptest/lamptest.cpp b/manager/lamptest/lamptest.cpp
index 2c93333..99d0318 100644
--- a/manager/lamptest/lamptest.cpp
+++ b/manager/lamptest/lamptest.cpp
@@ -11,8 +11,8 @@
using Json = nlohmann::json;
-bool LampTest::processLEDUpdates(const Manager::group& ledsAssert,
- const Manager::group& ledsDeAssert)
+bool LampTest::processLEDUpdates(const ActionSet& ledsAssert,
+ const ActionSet& ledsDeAssert)
{
// If the physical LED status is updated during the lamp test, it should be
// saved to Queue, and the queue will be processed after the lamp test is
@@ -232,7 +232,7 @@
void LampTest::restorePhysicalLedStates()
{
// restore physical LEDs states before lamp test
- Manager::group ledsDeAssert{};
+ ActionSet ledsDeAssert{};
manager.driveLEDs(physicalLEDStatesPriorToLampTest, ledsDeAssert);
physicalLEDStatesPriorToLampTest.clear();
diff --git a/manager/lamptest/lamptest.hpp b/manager/lamptest/lamptest.hpp
index d69667a..30d6eb2 100644
--- a/manager/lamptest/lamptest.hpp
+++ b/manager/lamptest/lamptest.hpp
@@ -64,8 +64,8 @@
*
* @return Is running lamp test, true running
*/
- bool processLEDUpdates(const Manager::group& ledsAssert,
- const Manager::group& ledsDeAssert);
+ bool processLEDUpdates(const ActionSet& ledsAssert,
+ const ActionSet& ledsDeAssert);
private:
/** @brief Timer used for LEDs lamp test period */
@@ -84,14 +84,13 @@
std::vector<std::string> physicalLEDPaths;
/** @brief Queue to save LED states during lamp test */
- std::queue<std::pair<Manager::group, Manager::group>>
- updatedLEDsDuringLampTest;
+ std::queue<std::pair<ActionSet, ActionSet>> updatedLEDsDuringLampTest;
/** @brief Get state of the lamp test operation */
bool isLampTestRunning{false};
/** @brief Physical LED states prior to lamp test */
- Manager::group physicalLEDStatesPriorToLampTest;
+ ActionSet physicalLEDStatesPriorToLampTest;
/** @brief Vector of names of physical LEDs, whose changes will be forcibly
* updated even during lamp test. */
diff --git a/manager/led-main.cpp b/manager/led-main.cpp
index 8861a64..a6f8f82 100644
--- a/manager/led-main.cpp
+++ b/manager/led-main.cpp
@@ -1,12 +1,12 @@
#include "config.h"
#include "group.hpp"
+#include "ledlayout.hpp"
#ifdef LED_USE_JSON
#include "json-parser.hpp"
#else
#include "led-gen.hpp"
#endif
-#include "ledlayout.hpp"
#include "manager.hpp"
#include "serialize.hpp"
#include "utils.hpp"
@@ -69,14 +69,11 @@
#endif
/** Now create so many dbus objects as there are groups */
- std::ranges::transform(
- systemLedMap, std::back_inserter(groups),
- [&bus, &manager, &serialize](
- const std::pair<std::string,
- std::set<phosphor::led::Layout::LedAction>>& grp) {
- return std::make_unique<phosphor::led::Group>(bus, grp.first,
- manager, serialize);
- });
+ std::ranges::transform(systemLedMap, std::back_inserter(groups),
+ [&bus, &manager, &serialize](auto& grp) {
+ return std::make_unique<phosphor::led::Group>(
+ bus, grp.first, manager, serialize);
+ });
// Attach the bus to sd_event to service user requests
bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
diff --git a/manager/ledlayout.hpp b/manager/ledlayout.hpp
index 3424606..7fc896d 100644
--- a/manager/ledlayout.hpp
+++ b/manager/ledlayout.hpp
@@ -49,5 +49,9 @@
}
};
} // namespace Layout
+
+using ActionSet = std::set<Layout::LedAction>;
+using GroupMap = std::unordered_map<std::string, ActionSet>;
+
} // namespace led
} // namespace phosphor
diff --git a/manager/manager.cpp b/manager/manager.cpp
index 998f22d..12f507a 100644
--- a/manager/manager.cpp
+++ b/manager/manager.cpp
@@ -16,7 +16,7 @@
// Assert -or- De-assert
bool Manager::setGroupState(const std::string& path, bool assert,
- group& ledsAssert, group& ledsDeAssert)
+ ActionSet& ledsAssert, ActionSet& ledsDeAssert)
{
if (assert)
{
@@ -30,8 +30,8 @@
}
}
- // This will contain the union of what's already in the asserted group
- group desiredState{};
+ // This will contain the union of what's already in the asserted ActionSet
+ ActionSet desiredState{};
for (const auto& grp : assertedGroups)
{
desiredState.insert(grp->cbegin(), grp->cend());
@@ -39,7 +39,7 @@
// Find difference between Combined and Desired to identify
// which LEDs are getting altered
- group transient{};
+ ActionSet transient{};
std::set_difference(combinedState.begin(), combinedState.end(),
desiredState.begin(), desiredState.end(),
std::inserter(transient, transient.begin()), ledComp);
@@ -47,7 +47,7 @@
{
// Find common LEDs between transient and Desired to know if some LEDs
// are changing state and not really getting DeAsserted
- group ledsTransient{};
+ ActionSet ledsTransient{};
std::set_intersection(
transient.begin(), transient.end(), desiredState.begin(),
desiredState.end(),
@@ -79,7 +79,7 @@
// Now LEDs that are to be Asserted. These could either be fresh asserts
// -or- change between [On]<-->[Blink]
- group temp{};
+ ActionSet temp{};
std::unique_copy(desiredState.begin(), desiredState.end(),
std::inserter(temp, temp.begin()), ledEqual);
if (temp.size())
@@ -100,13 +100,14 @@
}
void Manager::setLampTestCallBack(
- std::function<bool(group& ledsAssert, group& ledsDeAssert)> callBack)
+ std::function<bool(ActionSet& ledsAssert, ActionSet& ledsDeAssert)>
+ callBack)
{
lampTestCallBack = callBack;
}
/** @brief Run through the map and apply action on the LEDs */
-void Manager::driveLEDs(group& ledsAssert, group& ledsDeAssert)
+void Manager::driveLEDs(ActionSet& ledsAssert, ActionSet& ledsDeAssert)
{
#ifdef USE_LAMP_TEST
// Use the lampTestCallBack method and trigger the callback method in the
diff --git a/manager/manager.hpp b/manager/manager.hpp
index 88875d1..2fbc7f2 100644
--- a/manager/manager.hpp
+++ b/manager/manager.hpp
@@ -68,18 +68,15 @@
return left.name == right.name;
}
- using group = std::set<phosphor::led::Layout::LedAction>;
- using LedLayout = std::unordered_map<std::string, group>;
-
/** @brief static global map constructed at compile time */
- const LedLayout& ledMap;
+ const GroupMap& ledMap;
/** @brief Refer the user supplied LED layout and sdbusplus handler
*
* @param [in] bus - sdbusplus handler
- * @param [in] LedLayout - LEDs group layout
+ * @param [in] GroupMap - LEDs group layout
*/
- Manager(sdbusplus::bus::bus& bus, const LedLayout& ledLayout) :
+ Manager(sdbusplus::bus::bus& bus, const GroupMap& ledLayout) :
ledMap(ledLayout), bus(bus)
{
// Nothing here
@@ -95,8 +92,8 @@
*
* @return - Success or exception thrown
*/
- bool setGroupState(const std::string& path, bool assert, group& ledsAssert,
- group& ledsDeAssert);
+ bool setGroupState(const std::string& path, bool assert,
+ ActionSet& ledsAssert, ActionSet& ledsDeAssert);
/** @brief Finds the set of LEDs to operate on and executes action
*
@@ -106,7 +103,7 @@
*
* @return: None
*/
- void driveLEDs(group& ledsAssert, group& ledsDeAssert);
+ void driveLEDs(ActionSet& ledsAssert, ActionSet& ledsDeAssert);
/** @brief Chooses appropriate action to be triggered on physical LED
* and calls into function that applies the actual action.
@@ -124,7 +121,8 @@
* @param[in] callBack - Custom callback when enabled lamp test
*/
void setLampTestCallBack(
- std::function<bool(group& ledsAssert, group& ledsDeAssert)> callBack);
+ std::function<bool(ActionSet& ledsAssert, ActionSet& ledsDeAssert)>
+ callBack);
private:
/** @brief sdbusplus handler */
@@ -137,18 +135,18 @@
DBusHandler dBusHandler;
/** @brief Pointers to groups that are in asserted state */
- std::set<const group*> assertedGroups;
+ std::set<const ActionSet*> assertedGroups;
/** @brief Contains the highest priority actions for all
* asserted LEDs.
*/
- group currentState;
+ ActionSet currentState;
/** @brief Contains the set of all actions for asserted LEDs */
- group combinedState;
+ ActionSet combinedState;
/** @brief Custom callback when enabled lamp test */
- std::function<bool(group& ledsAssert, group& ledsDeAssert)>
+ std::function<bool(ActionSet& ledsAssert, ActionSet& ledsDeAssert)>
lampTestCallBack;
/** @brief Returns action string based on enum
diff --git a/scripts/parse_led.py b/scripts/parse_led.py
index 1464ba7..63cb4e5 100755
--- a/scripts/parse_led.py
+++ b/scripts/parse_led.py
@@ -47,8 +47,7 @@
ofile.write("/* !!! WARNING: This is a GENERATED Code..")
ofile.write("Please do NOT Edit !!! */\n\n")
- ofile.write("static const std::unordered_map<std::string,")
- ofile.write(" std::set<phosphor::led::Layout::LedAction>>")
+ ofile.write("static const phosphor::led::GroupMap")
ofile.write(" systemLedMap = {\n\n")
for group in list(ifile.keys()):
# This section generates an std::unordered_map of LedGroupNames to
diff --git a/test/led-test-map.hpp b/test/led-test-map.hpp
index b5f90ca..60d0363 100644
--- a/test/led-test-map.hpp
+++ b/test/led-test-map.hpp
@@ -1,133 +1,112 @@
#include "ledlayout.hpp"
-#include <set>
-#include <string>
-#include <unordered_map>
-
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- singleLedOn = {
- {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
- {
- {"One", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::Blink},
- }},
+static const phosphor::led::GroupMap singleLedOn = {
+ {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
+ {
+ {"One", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- singleLedBlink = {
- {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
- {
- {"One", phosphor::led::Layout::Action::Blink, 0, 0,
- phosphor::led::Layout::Action::Blink},
- }},
+static const phosphor::led::GroupMap singleLedBlink = {
+ {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
+ {
+ {"One", phosphor::led::Layout::Action::Blink, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- singleLedBlinkOverrideOn = {
- {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
- {
- {"One", phosphor::led::Layout::Action::Blink, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
+static const phosphor::led::GroupMap singleLedBlinkOverrideOn = {
+ {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
+ {
+ {"One", phosphor::led::Layout::Action::Blink, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- multipleLedsOn = {
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
- {
- {"One", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Two", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Three", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
+static const phosphor::led::GroupMap multipleLedsOn = {
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
+ {
+ {"One", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Two", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Three", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- multipleLedsBlink = {
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
- {
- {"One", phosphor::led::Layout::Action::Blink, 0, 0,
- phosphor::led::Layout::Action::Blink},
- {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
- phosphor::led::Layout::Action::Blink},
- {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
- phosphor::led::Layout::Action::Blink},
- }},
+static const phosphor::led::GroupMap multipleLedsBlink = {
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
+ {
+ {"One", phosphor::led::Layout::Action::Blink, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- multipleLedsOnAndBlink = {
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix",
- {
- {"One", phosphor::led::Layout::Action::Blink, 0, 0,
- phosphor::led::Layout::Action::Blink},
- {"Two", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::Blink},
- {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Four", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::Blink},
- {"Five", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::Blink},
- }},
+static const phosphor::led::GroupMap multipleLedsOnAndBlink = {
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix",
+ {
+ {"One", phosphor::led::Layout::Action::Blink, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ {"Two", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Four", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ {"Five", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- twoGroupsWithDistinctLEDsOn = {
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
- {
- {"One", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::Blink},
- {"Two", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Three", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::Blink},
- }},
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
- {
- {"Four", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::Blink},
- {"Five", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::Blink},
- {"Six", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
+static const phosphor::led::GroupMap twoGroupsWithDistinctLEDsOn = {
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
+ {
+ {"One", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ {"Two", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Three", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ }},
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
+ {
+ {"Four", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ {"Five", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::Blink},
+ {"Six", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- twoGroupsWithOneComonLEDOn = {
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
- {
- {"One", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Two", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Three", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
- {
- {"Four", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Three", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Six", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
+static const phosphor::led::GroupMap twoGroupsWithOneComonLEDOn = {
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
+ {
+ {"One", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Two", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Three", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
+ {
+ {"Four", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Three", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Six", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
+static const phosphor::led::GroupMap
twoGroupsWithOneComonLEDOnOneLEDBlinkPriority = {
{"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
{
@@ -149,56 +128,51 @@
}},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- twoGroupsWithOneComonLEDOnPriority = {
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
- {
- {"One", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Two", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
- {
- {"Four", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Three", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Six", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
+static const phosphor::led::GroupMap twoGroupsWithOneComonLEDOnPriority = {
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
+ {
+ {"One", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Two", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
+ {
+ {"Four", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Three", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Six", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
- twoGroupsWithMultiplComonLEDOn = {
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
- {
- {"One", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Two", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Three", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
- {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
- {
- {"Two", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Six", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Three", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- {"Seven", phosphor::led::Layout::Action::On, 0, 0,
- phosphor::led::Layout::Action::On},
- }},
+static const phosphor::led::GroupMap twoGroupsWithMultiplComonLEDOn = {
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
+ {
+ {"One", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Two", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Three", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
+ {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
+ {
+ {"Two", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Six", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Three", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ {"Seven", phosphor::led::Layout::Action::On, 0, 0,
+ phosphor::led::Layout::Action::On},
+ }},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
+static const phosphor::led::GroupMap
twoGroupsWithMultipleComonLEDInDifferentState = {
{"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
{
@@ -224,8 +198,7 @@
}},
};
-static const std::unordered_map<std::string,
- std::set<phosphor::led::Layout::LedAction>>
+static const phosphor::led::GroupMap
twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority = {
{"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
{
diff --git a/test/utest-led-json.cpp b/test/utest-led-json.cpp
index b9b6e24..853f4d1 100644
--- a/test/utest-led-json.cpp
+++ b/test/utest-led-json.cpp
@@ -5,7 +5,7 @@
TEST(loadJsonConfig, testGoodPath)
{
static constexpr auto jsonPath = "config/led-group-config.json";
- LedMap ledMap = loadJsonConfig(jsonPath);
+ auto ledMap = loadJsonConfig(jsonPath);
std::string objPath = "/xyz/openbmc_project/led/groups";
std::string bmcBooted = objPath + "/bmc_booted";
@@ -16,9 +16,9 @@
ASSERT_EQ(ledMap.contains(powerOn), true);
ASSERT_EQ(ledMap.contains(enclosureIdentify), true);
- LedAction bmcBootedActions = ledMap.at(bmcBooted);
- LedAction powerOnActions = ledMap.at(powerOn);
- LedAction enclosureIdentifyActions = ledMap.at(enclosureIdentify);
+ auto& bmcBootedActions = ledMap.at(bmcBooted);
+ auto& powerOnActions = ledMap.at(powerOn);
+ auto& enclosureIdentifyActions = ledMap.at(enclosureIdentify);
for (const auto& group : bmcBootedActions)
{
@@ -91,4 +91,4 @@
phosphor::led::Layout::Action::On,
priorityMap),
std::runtime_error);
-}
\ No newline at end of file
+}
diff --git a/test/utest.cpp b/test/utest.cpp
index f695ee7..9375600 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -28,8 +28,8 @@
Manager manager(bus, singleLedOn);
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
auto result =
@@ -37,7 +37,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::Blink},
};
@@ -45,7 +45,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -59,8 +59,8 @@
Manager manager(bus, singleLedBlink);
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
auto result =
@@ -68,7 +68,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::Blink},
};
@@ -76,7 +76,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -90,8 +90,8 @@
Manager manager(bus, singleLedOn);
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
auto result =
@@ -99,7 +99,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::Blink},
};
@@ -107,7 +107,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -115,8 +115,8 @@
}
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/SingleLed";
auto result =
@@ -134,8 +134,8 @@
Manager manager(bus, multipleLedsOn);
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
@@ -143,7 +143,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -155,7 +155,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -169,8 +169,8 @@
Manager manager(bus, multipleLedsBlink);
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
@@ -178,7 +178,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::Blink},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -190,7 +190,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -204,8 +204,8 @@
Manager manager(bus, multipleLedsBlink);
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
@@ -213,7 +213,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::Blink},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -225,7 +225,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -233,8 +233,8 @@
}
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
@@ -242,7 +242,7 @@
EXPECT_EQ(false, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"One", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::Blink},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -254,7 +254,7 @@
EXPECT_EQ(0, ledsAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -268,8 +268,8 @@
Manager manager(bus, multipleLedsBlink);
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
@@ -277,7 +277,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::Blink},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -289,7 +289,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -297,8 +297,8 @@
}
{
// DeAssert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
@@ -306,7 +306,7 @@
EXPECT_EQ(false, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"One", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::Blink},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -318,7 +318,7 @@
EXPECT_EQ(0, ledsAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -326,8 +326,8 @@
}
{
// DeAssert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLeds";
auto result =
@@ -344,8 +344,8 @@
Manager manager(bus, multipleLedsOnAndBlink);
{
// Assert the LEDs.
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix";
auto result =
@@ -353,7 +353,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::Blink},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -369,7 +369,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -383,8 +383,8 @@
Manager manager(bus, twoGroupsWithDistinctLEDsOn);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -392,7 +392,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::Blink},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -404,7 +404,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -412,8 +412,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -421,7 +421,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Four", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::Blink},
{"Five", phosphor::led::Layout::Action::On, 0, 0,
@@ -433,7 +433,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -447,8 +447,8 @@
Manager manager(bus, twoGroupsWithOneComonLEDOn);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -456,7 +456,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -468,7 +468,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -476,8 +476,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -485,7 +485,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Four", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -495,7 +495,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -510,8 +510,8 @@
Manager manager(bus, twoGroupsWithOneComonLEDOnOneLEDBlinkPriority);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -519,7 +519,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -531,7 +531,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -539,8 +539,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -549,7 +549,7 @@
// Need just the ledsAssserted populated with these.
// Does not action on [Three] since priority is [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Four", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -559,7 +559,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -567,8 +567,8 @@
}
{
// De-Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -576,7 +576,7 @@
EXPECT_EQ(false, result);
// Need just the ledsDeAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"Four", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -587,7 +587,7 @@
// difference of refDeAssert and ledsDeAssert must be null.
// [Three] is not touched since its already [Blink]
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -602,8 +602,8 @@
Manager manager(bus, twoGroupsWithOneComonLEDOnOneLEDBlinkPriority);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -611,7 +611,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -623,7 +623,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -631,8 +631,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -641,7 +641,7 @@
// Need just the ledsAssserted populated with these.
// [Three] does not get actioned since it has Blink priority
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Four", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -651,7 +651,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -659,8 +659,8 @@
}
{
// De-Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -668,7 +668,7 @@
EXPECT_EQ(false, result);
// Need just the ledsDeAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -677,21 +677,21 @@
EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
EXPECT_EQ(0, temp.size());
// Need just the ledsAssert populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Three", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::Blink},
};
EXPECT_EQ(refAssert.size(), ledsAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp1{};
+ ActionSet temp1{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp1, temp1.begin()));
@@ -706,8 +706,8 @@
Manager manager(bus, twoGroupsWithOneComonLEDOnPriority);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -715,7 +715,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -727,7 +727,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -735,8 +735,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -745,7 +745,7 @@
// Need just the ledsAssserted populated with these.
// Three is set to ON due to ON priority.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Three", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Four", phosphor::led::Layout::Action::On, 0, 0,
@@ -757,15 +757,15 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
}
{
// De-Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -774,7 +774,7 @@
// Need just the ledsDeAssserted populated with these.
// [Three] stays in [On] since [B] has it [On]
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -784,7 +784,7 @@
EXPECT_EQ(0, ledsAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -799,8 +799,8 @@
Manager manager(bus, twoGroupsWithOneComonLEDOnPriority);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -808,7 +808,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::On, 0, 0,
@@ -820,7 +820,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -828,8 +828,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -838,7 +838,7 @@
// Need just the ledsAssserted populated with these.
// Three is set to ON due to ON priority.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Three", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Four", phosphor::led::Layout::Action::On, 0, 0,
@@ -850,15 +850,15 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
}
{
// De-Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -866,7 +866,7 @@
EXPECT_EQ(false, result);
// Need just the ledsDeAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"Four", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -875,7 +875,7 @@
EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -883,14 +883,14 @@
// Need just the ledsAssert populated with these.
// Since [Three] stood [On], need to go back to [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Three", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::On},
};
EXPECT_EQ(refAssert.size(), ledsAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp1{};
+ ActionSet temp1{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -904,8 +904,8 @@
Manager manager(bus, twoGroupsWithMultiplComonLEDOn);
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -913,7 +913,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -927,7 +927,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -935,8 +935,8 @@
}
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -944,7 +944,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
};
@@ -952,7 +952,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -960,8 +960,8 @@
}
{
// De-Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -969,7 +969,7 @@
EXPECT_EQ(false, result);
// Need just the ledsDeAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"Six", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Seven", phosphor::led::Layout::Action::On, 0, 0,
@@ -979,7 +979,7 @@
EXPECT_EQ(0, ledsAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -993,8 +993,8 @@
Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentState);
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1002,7 +1002,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Three", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -1016,7 +1016,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1024,8 +1024,8 @@
}
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1035,7 +1035,7 @@
// Need just the ledsAssserted populated with these
// [Two] remains [On] due to higher priority.
// [Three] remains [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Four", phosphor::led::Layout::Action::On, 0, 0,
@@ -1045,7 +1045,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1059,8 +1059,8 @@
Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentState);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1069,7 +1069,7 @@
// Need just the ledsAssserted populated with these.'Two' gets to Blink
// due to higher priority.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -1083,7 +1083,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1091,8 +1091,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1102,7 +1102,7 @@
// Need just the ledsAssserted populated with these.
// [Three] remains [Blink] from previous
// [Two] moves to [On] from [Blink] due to [On] priority
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Five", phosphor::led::Layout::Action::On, 0, 0,
@@ -1114,7 +1114,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1131,8 +1131,8 @@
Manager manager(bus, twoGroupsWithMultipleComonLEDInDifferentState);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1140,7 +1140,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -1154,7 +1154,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1162,8 +1162,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1173,7 +1173,7 @@
// Need just the ledsAssserted populated with these.
// [Two] turns [On] due to priority
// [Three] remains [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Five", phosphor::led::Layout::Action::On, 0, 0,
@@ -1185,7 +1185,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1193,8 +1193,8 @@
}
{
// DeAssert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1202,7 +1202,7 @@
EXPECT_EQ(false, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"Five", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -1211,7 +1211,7 @@
EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1219,14 +1219,14 @@
// Need just the ledsAssert populated with these.
// [Two] will go back to [Blink] from [On]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::On},
};
EXPECT_EQ(refAssert.size(), ledsAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp1{};
+ ActionSet temp1{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp1, temp1.begin()));
@@ -1234,8 +1234,8 @@
}
{
// DeAssert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1243,7 +1243,7 @@
EXPECT_EQ(false, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -1257,7 +1257,7 @@
EXPECT_EQ(0, ledsAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1265,8 +1265,8 @@
}
{
// DeAssert Set-A again and make sure we get all empty
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1287,8 +1287,8 @@
twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1296,7 +1296,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -1312,7 +1312,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1320,8 +1320,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1332,7 +1332,7 @@
// [Two] gets to [ON] due to higher priority.
// [Three] remains on since it never was in [Blink] before
// [Ten] remains [Blink] due to priority: [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Five", phosphor::led::Layout::Action::On, 0, 0,
@@ -1344,7 +1344,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1352,8 +1352,8 @@
}
{
// De-Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1361,7 +1361,7 @@
EXPECT_EQ(false, result);
// Need just the ledsDeAsssert populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Four", phosphor::led::Layout::Action::On, 0, 0,
@@ -1373,14 +1373,14 @@
// [Ten] Moves to [On] since there is no prior [Blink]
// [Three] remains [On] since it never changed state.
// [Two] remains [On] since it did not go back
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Ten", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::Blink},
};
EXPECT_EQ(refAssert.size(), ledsAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1399,8 +1399,8 @@
twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1408,7 +1408,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -1424,7 +1424,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1432,8 +1432,8 @@
}
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1444,7 +1444,7 @@
// [Two] gets to [ON] due to higher priority.
// [Three] remains on since it never was in [Blink] before
// [Ten] remains [Blink] due to priority: [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Five", phosphor::led::Layout::Action::On, 0, 0,
@@ -1456,7 +1456,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1464,8 +1464,8 @@
}
{
// De-Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1473,7 +1473,7 @@
EXPECT_EQ(false, result);
// Need just the ledsDeAsssert populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"Five", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -1485,14 +1485,14 @@
// [Ten] remains [Blink] since it did not move to [On]
// [Three] remains [On] since it never changed state.
// [Two] moves to [Blink] since there is no prior [On]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::On},
};
EXPECT_EQ(refAssert.size(), ledsAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1510,8 +1510,8 @@
twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1519,7 +1519,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Three", phosphor::led::Layout::Action::On, 0, 0,
@@ -1535,7 +1535,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1543,8 +1543,8 @@
}
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1555,7 +1555,7 @@
// [Two] remains [ON] due to higher priority.
// [Three] remains on since it never was in [Blink] before
// [Ten] moves to [Blink] due to priority: [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Four", phosphor::led::Layout::Action::On, 0, 0,
@@ -1567,7 +1567,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1586,8 +1586,8 @@
twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1595,7 +1595,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Three", phosphor::led::Layout::Action::On, 0, 0,
@@ -1611,7 +1611,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1619,8 +1619,8 @@
}
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1631,7 +1631,7 @@
// [Two] remains [ON] due to higher priority.
// [Three] remains on since it never was in [Blink] before
// [Ten] moves to [Blink] due to priority: [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Four", phosphor::led::Layout::Action::On, 0, 0,
@@ -1643,7 +1643,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1651,8 +1651,8 @@
}
{
// De-Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1661,7 +1661,7 @@
// Need just the ledsAssserted populated with these.
// [Ten] remains [Blink] due to priority.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Four", phosphor::led::Layout::Action::On, 0, 0,
@@ -1673,14 +1673,14 @@
// [Two] remains [ON] due to higher priority.
// [Three] remains [On] since it never was in [Blink] before
// [Ten] moves to [On] due to priority: [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Ten", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::Blink},
};
EXPECT_EQ(refAssert.size(), ledsAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1698,8 +1698,8 @@
twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority);
{
// Assert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1707,7 +1707,7 @@
EXPECT_EQ(true, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Three", phosphor::led::Layout::Action::On, 0, 0,
@@ -1723,7 +1723,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1731,8 +1731,8 @@
}
{
// Assert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1743,7 +1743,7 @@
// [Two] remains [ON] due to higher priority.
// [Three] remains on since it never was in [Blink] before
// [Ten] moves to [Blink] due to priority: [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Four", phosphor::led::Layout::Action::On, 0, 0,
@@ -1755,7 +1755,7 @@
EXPECT_EQ(0, ledsDeAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1763,8 +1763,8 @@
}
{
// DeAssert Set-B
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =
@@ -1773,7 +1773,7 @@
// Need just the ledsAssserted populated with these.
// [Ten] remains [Blink] due to priority.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"Five", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Six", phosphor::led::Layout::Action::On, 0, 0,
@@ -1782,7 +1782,7 @@
EXPECT_EQ(refDeAssert.size(), ledsDeAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1790,14 +1790,14 @@
// Need just the ledsAssert populated with these.
// [Two] will move to [Blink]
- std::set<Layout::LedAction> refAssert = {
+ ActionSet refAssert = {
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
phosphor::led::Layout::Action::On},
};
EXPECT_EQ(refAssert.size(), ledsAssert.size());
// difference of refAssert and ledsAssert must be null.
- Manager::group temp1{};
+ ActionSet temp1{};
std::set_difference(ledsAssert.begin(), ledsAssert.end(),
refAssert.begin(), refAssert.end(),
std::inserter(temp1, temp1.begin()));
@@ -1805,8 +1805,8 @@
}
{
// DeAssert Set-A
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet";
auto result =
@@ -1814,7 +1814,7 @@
EXPECT_EQ(false, result);
// Need just the ledsAssserted populated with these.
- std::set<Layout::LedAction> refDeAssert = {
+ ActionSet refDeAssert = {
{"One", phosphor::led::Layout::Action::On, 0, 0,
phosphor::led::Layout::Action::On},
{"Two", phosphor::led::Layout::Action::Blink, 0, 0,
@@ -1830,7 +1830,7 @@
EXPECT_EQ(0, ledsAssert.size());
// difference of refDeAssert and ledsDeAssert must be null.
- Manager::group temp{};
+ ActionSet temp{};
std::set_difference(ledsDeAssert.begin(), ledsDeAssert.end(),
refDeAssert.begin(), refDeAssert.end(),
std::inserter(temp, temp.begin()));
@@ -1838,8 +1838,8 @@
}
{
// DeAssert Set-B again and make sure we get all empty
- Manager::group ledsAssert{};
- Manager::group ledsDeAssert{};
+ ActionSet ledsAssert{};
+ ActionSet ledsDeAssert{};
auto group = "/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet";
auto result =