summaryrefslogtreecommitdiffstats
path: root/group.cpp
diff options
context:
space:
mode:
authorVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2016-12-20 15:59:29 +0530
committerVishwanatha Subbanna <vishwa@linux.vnet.ibm.com>2017-01-17 21:48:42 +0530
commited4907342897301ab96cbf2c617cafd78caf25a1 (patch)
treef91f21b7794892ca8d6d23b58a5d1ca0e97bb9d9 /group.cpp
parent98691fa88d107a1649847b032f1a9b1218061324 (diff)
downloadphosphor-led-manager-ed4907342897301ab96cbf2c617cafd78caf25a1.tar.gz
phosphor-led-manager-ed4907342897301ab96cbf2c617cafd78caf25a1.zip
Enable gtest for testing LED set operations
This patchset enables gtest to allow different combinations of LED set operations to be verified at build time. Change-Id: I9c2ddf82c2e23be911233b23037ee44e3ce301db Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'group.cpp')
-rw-r--r--group.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/group.cpp b/group.cpp
index 8ed2ab0..fda5982 100644
--- a/group.cpp
+++ b/group.cpp
@@ -8,8 +8,20 @@ namespace led
/** @brief Overloaded Property Setter function */
bool Group::asserted(bool value)
{
- // Group management is handled by Manager
- auto result = manager.setGroupState(path, value);
+ // Introducing these to enable gtest.
+ Manager::group ledsAssert {};
+ Manager::group ledsDeAssert {};
+ Manager::group ledsUpdate {};
+
+ // Group management is handled by Manager. The populated leds* sets are not
+ // really used by production code. They are there to enable gtest for
+ // validation.
+ auto result = manager.setGroupState(path, value, ledsAssert,
+ ledsDeAssert, ledsUpdate);
+
+ // If something does not go right here, then there should be an sdbusplus
+ // exception thrown.
+ manager.driveLEDs(ledsAssert, ledsDeAssert, ledsUpdate);
// Set the base class's asserted to 'true' since the getter
// operation is handled there.
OpenPOWER on IntegriCloud