HealthIF extensions and upstream updates #82

Merged
meierj merged 36 commits from mueller/health-if-extension-eive into develop 2022-05-13 14:56:51 +02:00
Showing only changes of commit b764194ed0 - Show all commits

View File

@ -22,6 +22,7 @@ TEST_CASE("Power Switcher", "[power-switcher]") {
switcher.turnOn(true); switcher.turnOn(true);
REQUIRE(mock.getAmountSwitchStatWasRequested() == 1); REQUIRE(mock.getAmountSwitchStatWasRequested() == 1);
REQUIRE(switcher.getState() == PowerSwitcher::WAIT_ON); REQUIRE(switcher.getState() == PowerSwitcher::WAIT_ON);
REQUIRE(switcher.checkSwitchState() == PowerSwitcher::IN_POWER_TRANSITION);
REQUIRE(switcher.active()); REQUIRE(switcher.active());
switcher.doStateMachine(); switcher.doStateMachine();
REQUIRE(switcher.getState() == PowerSwitcher::SWITCH_IS_ON); REQUIRE(switcher.getState() == PowerSwitcher::SWITCH_IS_ON);
@ -29,8 +30,10 @@ TEST_CASE("Power Switcher", "[power-switcher]") {
REQUIRE(switchInfo.timesCalledOn == 1); REQUIRE(switchInfo.timesCalledOn == 1);
REQUIRE(not switcher.active()); REQUIRE(not switcher.active());
REQUIRE(mock.getAmountSwitchStatWasRequested() == 2); REQUIRE(mock.getAmountSwitchStatWasRequested() == 2);
REQUIRE(switcher.checkSwitchState() == HasReturnvaluesIF::RETURN_OK);
REQUIRE(mock.getAmountSwitchStatWasRequested() == 3);
switcher.turnOff(false); switcher.turnOff(false);
REQUIRE(mock.getAmountSwitchStatWasRequested() == 2); REQUIRE(mock.getAmountSwitchStatWasRequested() == 3);
REQUIRE(switcher.getState() == PowerSwitcher::WAIT_OFF); REQUIRE(switcher.getState() == PowerSwitcher::WAIT_OFF);
REQUIRE(switcher.active()); REQUIRE(switcher.active());
REQUIRE(switcher.getState() == PowerSwitcher::WAIT_OFF); REQUIRE(switcher.getState() == PowerSwitcher::WAIT_OFF);
@ -40,7 +43,7 @@ TEST_CASE("Power Switcher", "[power-switcher]") {
REQUIRE(switchInfo.timesCalledOn == 1); REQUIRE(switchInfo.timesCalledOn == 1);
REQUIRE(switchInfo.timesCalledOff == 1); REQUIRE(switchInfo.timesCalledOff == 1);
REQUIRE(not switcher.active()); REQUIRE(not switcher.active());
REQUIRE(mock.getAmountSwitchStatWasRequested() == 3); REQUIRE(mock.getAmountSwitchStatWasRequested() == 4);
} }
SECTION("Dummy Test") { SECTION("Dummy Test") {
@ -63,4 +66,8 @@ TEST_CASE("Power Switcher", "[power-switcher]") {
REQUIRE(switcherUsingDummy.getState() == PowerSwitcher::SWITCH_IS_OFF); REQUIRE(switcherUsingDummy.getState() == PowerSwitcher::SWITCH_IS_OFF);
REQUIRE(not switcherUsingDummy.active()); REQUIRE(not switcherUsingDummy.active());
} }
SECTION("More Dummy Tests") {
}
} }