test: physical: Cover trigger:timer branch in setInitialState()
The test causes execution to take the following path in
setInitialState(), previously outlined in 264d909d3dc9 ("test: Add tests
for Physical class") as being missed:
auto trigger = led.getTrigger();
if (trigger == "timer")
{
// LED is blinking. Get the delay_on and delay_off and compute
// DutyCycle. sfsfs values are in strings. Need to convert 'em over to
// integer.
auto delayOn = led.getDelayOn();
auto delayOff = led.getDelayOff();
// Calculate frequency and then percentage ON
frequency = delayOn + delayOff;
auto factor = frequency / 100;
auto dutyOn = delayOn / factor;
// Update.
this->dutyOn(dutyOn);
}
This brings the line coverage to 96.6% (function coverage remains
unchanged by this patch).
Change-Id: Ie311186f6275d3fdd31de5698c7c14bb335128e1
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
1 file changed