Make notifier command tests a lot more lenient (#2056)

They don't need to be testing timing, just that the command starts and stops.
This commit is contained in:
Thad House
2019-11-07 17:26:29 -08:00
committed by Peter Johnson
parent 0ebe32823a
commit 6858a57f72
2 changed files with 5 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ import org.junit.jupiter.api.condition.OS;
import edu.wpi.first.wpilibj.Timer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@DisabledOnOs(OS.MAC)
class NotifierCommandTest extends CommandTestBase {
@@ -29,6 +29,7 @@ class NotifierCommandTest extends CommandTestBase {
Timer.delay(.25);
scheduler.cancel(command);
assertEquals(.25, 0.01 * counter.m_counter, .025);
assertTrue(counter.m_counter > 10, "Should have hit at least 10 triggers");
assertTrue(counter.m_counter < 100, "Shouldn't hit more then 100 triggers");
}
}