diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2018-05-24 13:34:05 +0930 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2019-04-08 13:48:02 +0930 |
commit | 42e02d34113534c2e98dfd321fa79671fa7e1d20 (patch) | |
tree | 8b21eb3c30f92a56599bb2d49474f57da49587d6 /test/physical.cpp | |
parent | e185efb810f0befb26276c776d71ed8e56059a1a (diff) | |
download | phosphor-led-sysfs-42e02d34113534c2e98dfd321fa79671fa7e1d20.tar.gz phosphor-led-sysfs-42e02d34113534c2e98dfd321fa79671fa7e1d20.zip |
sysfs: Integrate class into Physical and tests
Change-Id: I7d5ad19df5ef1258a4e669ea3243b7411f371d9c
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'test/physical.cpp')
-rw-r--r-- | test/physical.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/test/physical.cpp b/test/physical.cpp index 9ab4a30..4316b16 100644 --- a/test/physical.cpp +++ b/test/physical.cpp @@ -8,30 +8,35 @@ constexpr auto LED_OBJ = "/foo/bar/led"; constexpr auto LED_SYSFS = "/sys/class/leds/test"; using Action = sdbusplus::xyz::openbmc_project::Led::server::Physical::Action; +namespace fs = std::experimental::filesystem; TEST(Physical, ctor) { sdbusplus::bus::bus bus = sdbusplus::bus::new_default(); - phosphor::led::Physical led(bus, LED_OBJ, LED_SYSFS); + phosphor::led::SysfsLed led{fs::path(LED_SYSFS)}; + phosphor::led::Physical phy(bus, LED_OBJ, led); } TEST(Physical, off) { sdbusplus::bus::bus bus = sdbusplus::bus::new_default(); - phosphor::led::Physical led(bus, LED_OBJ, LED_SYSFS); - led.state(Action::Off); + phosphor::led::SysfsLed led{fs::path(LED_SYSFS)}; + phosphor::led::Physical phy(bus, LED_OBJ, led); + phy.state(Action::Off); } TEST(Physical, on) { sdbusplus::bus::bus bus = sdbusplus::bus::new_default(); - phosphor::led::Physical led(bus, LED_OBJ, LED_SYSFS); - led.state(Action::On); + phosphor::led::SysfsLed led{fs::path(LED_SYSFS)}; + phosphor::led::Physical phy(bus, LED_OBJ, led); + phy.state(Action::On); } TEST(Physical, blink) { sdbusplus::bus::bus bus = sdbusplus::bus::new_default(); - phosphor::led::Physical led(bus, LED_OBJ, LED_SYSFS); - led.state(Action::Blink); + phosphor::led::SysfsLed led{fs::path(LED_SYSFS)}; + phosphor::led::Physical phy(bus, LED_OBJ, led); + phy.state(Action::Blink); } |