action: use PDI type
Rather than define our own enumeration for the LED Actions,
reuse the one from Led.Physical's dbus interface.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I4615bed9e87c61d2632fe790bd50892a7f51e2ab
diff --git a/test/utest-led-json.cpp b/test/utest-led-json.cpp
index e2d8edb..b9b6e24 100644
--- a/test/utest-led-json.cpp
+++ b/test/utest-led-json.cpp
@@ -23,36 +23,36 @@
for (const auto& group : bmcBootedActions)
{
ASSERT_EQ(group.name, "heartbeat");
- ASSERT_EQ(group.action, phosphor::led::Layout::On);
+ ASSERT_EQ(group.action, phosphor::led::Layout::Action::On);
ASSERT_EQ(group.dutyOn, 50);
ASSERT_EQ(group.period, 0);
- ASSERT_EQ(group.priority, phosphor::led::Layout::Blink);
+ ASSERT_EQ(group.priority, phosphor::led::Layout::Action::Blink);
}
for (const auto& group : powerOnActions)
{
ASSERT_EQ(group.name, "power");
- ASSERT_EQ(group.action, phosphor::led::Layout::On);
+ ASSERT_EQ(group.action, phosphor::led::Layout::Action::On);
ASSERT_EQ(group.dutyOn, 50);
ASSERT_EQ(group.period, 0);
- ASSERT_EQ(group.priority, phosphor::led::Layout::On);
+ ASSERT_EQ(group.priority, phosphor::led::Layout::Action::On);
}
for (const auto& group : enclosureIdentifyActions)
{
if (group.name == "front_id")
{
- ASSERT_EQ(group.action, phosphor::led::Layout::Blink);
+ ASSERT_EQ(group.action, phosphor::led::Layout::Action::Blink);
ASSERT_EQ(group.dutyOn, 50);
ASSERT_EQ(group.period, 1000);
- ASSERT_EQ(group.priority, phosphor::led::Layout::Blink);
+ ASSERT_EQ(group.priority, phosphor::led::Layout::Action::Blink);
}
else if (group.name == "rear_id")
{
- ASSERT_EQ(group.action, phosphor::led::Layout::Blink);
+ ASSERT_EQ(group.action, phosphor::led::Layout::Action::Blink);
ASSERT_EQ(group.dutyOn, 50);
ASSERT_EQ(group.period, 1000);
- ASSERT_EQ(group.priority, phosphor::led::Layout::Blink);
+ ASSERT_EQ(group.priority, phosphor::led::Layout::Action::Blink);
}
else
{
@@ -70,20 +70,25 @@
TEST(validatePriority, testGoodPriority)
{
PriorityMap priorityMap{};
- validatePriority("heartbeat", phosphor::led::Layout::Blink, priorityMap);
- validatePriority("power", phosphor::led::Layout::On, priorityMap);
+ validatePriority("heartbeat", phosphor::led::Layout::Action::Blink,
+ priorityMap);
+ validatePriority("power", phosphor::led::Layout::Action::On, priorityMap);
- ASSERT_EQ(priorityMap.at("heartbeat"), phosphor::led::Layout::Blink);
- ASSERT_EQ(priorityMap.at("power"), phosphor::led::Layout::On);
+ ASSERT_EQ(priorityMap.at("heartbeat"),
+ phosphor::led::Layout::Action::Blink);
+ ASSERT_EQ(priorityMap.at("power"), phosphor::led::Layout::Action::On);
}
TEST(validatePriority, testBadPriority)
{
PriorityMap priorityMap{};
- validatePriority("heartbeat", phosphor::led::Layout::Blink, priorityMap);
+ validatePriority("heartbeat", phosphor::led::Layout::Action::Blink,
+ priorityMap);
- ASSERT_EQ(priorityMap.at("heartbeat"), phosphor::led::Layout::Blink);
- ASSERT_THROW(
- validatePriority("heartbeat", phosphor::led::Layout::On, priorityMap),
- std::runtime_error);
+ ASSERT_EQ(priorityMap.at("heartbeat"),
+ phosphor::led::Layout::Action::Blink);
+ ASSERT_THROW(validatePriority("heartbeat",
+ phosphor::led::Layout::Action::On,
+ priorityMap),
+ std::runtime_error);
}
\ No newline at end of file