[commands] Notify DriverStationSim in CommandTestBaseWithParam (#5400)

This commit is contained in:
Joseph Eng
2023-06-19 22:56:56 -07:00
committed by GitHub
parent d4ea5fa902
commit 316cd2a453
3 changed files with 18 additions and 20 deletions

View File

@@ -11,22 +11,20 @@ CommandTestBase::CommandTestBase() {
scheduler.CancelAll();
scheduler.Enable();
scheduler.GetActiveButtonLoop()->Clear();
SetDSEnabled(true);
}
CommandTestBase::~CommandTestBase() {
CommandScheduler::GetInstance().GetActiveButtonLoop()->Clear();
}
CommandScheduler CommandTestBase::GetScheduler() {
return CommandScheduler();
}
void CommandTestBase::SetUp() {
frc::sim::DriverStationSim::SetEnabled(true);
frc::sim::DriverStationSim::NotifyNewData();
}
void CommandTestBase::TearDown() {
CommandScheduler::GetInstance().GetActiveButtonLoop()->Clear();
}
void CommandTestBase::SetDSEnabled(bool enabled) {
frc::sim::DriverStationSim::SetDsAttached(true);
frc::sim::DriverStationSim::SetEnabled(enabled);
frc::sim::DriverStationSim::NotifyNewData();
}