Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
Resolved static checks errors (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeethaSujana committed Oct 5, 2020
1 parent 25a4c0b commit f641b31
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <catch2/catch.hpp>

#include <Pufferfish/HAL/Mock/MockDigitalInput.h>
#include <Pufferfish/HAL/Mock/MockTime.h>
#include <Pufferfish/Driver/Button/Button.h>
#include "catch2/catch.hpp"
#include "Pufferfish/HAL/Mock/MockDigitalInput.h"
#include "Pufferfish/HAL/Mock/MockTime.h"
#include "Pufferfish/Driver/Button/Button.h"

namespace PF = Pufferfish;

Expand Down Expand Up @@ -89,7 +88,7 @@ SCENARIO("TESTSCENARIO 1 : Valid debounce time", "[Button]") {
}
REQUIRE(button_status == PF::Driver::Button::ButtonStatus::ok);
REQUIRE(output == true);
THEN("Switch state changed from active high to low and Integration time is less than max Time") {
THEN("Switch state from active high to low and integration time is less than max Time") {
input = true;
for (uint32_t currentTime = 150; currentTime < 200; currentTime++) {
button_status = switch_input.transform(input, currentTime, output);
Expand Down Expand Up @@ -210,7 +209,7 @@ SCENARIO("TESTSCENARIO 4 : Validate read_state ", "[Button]") {
REQUIRE(PrevEdgeState == testEdgeState);
}
}
WHEN("Current time is greater the last sample time and debounced_time is greater than max_integrator_samples on push") {
WHEN("Debounced_time is greater than max_integrator_samples on push") {
buttonInput.set_read(false);
for (uint32_t i = 1; i < 101; i++) {
buttonInput.set_read(true);
Expand All @@ -222,7 +221,7 @@ SCENARIO("TESTSCENARIO 4 : Validate read_state ", "[Button]") {
REQUIRE(testEdgeState == PF::Driver::Button::EdgeState::rising_edge);
}
}
WHEN("Current time is greater than the last sample Time and debounced time is greater than the max_integrator_samples on Release") {
WHEN("Debounced time is greater than the max_integrator_samples on Release") {
buttonInput.set_read(false);
for (uint32_t i = 1; i < 101; i++) {
buttonInput.set_read(true);
Expand All @@ -244,4 +243,4 @@ SCENARIO("TESTSCENARIO 4 : Validate read_state ", "[Button]") {
}
}
}
}
}

0 comments on commit f641b31

Please sign in to comment.