[commands] Remove EndlessCommand (#4483)

This commit is contained in:
Starlight220
2022-10-21 03:24:54 +03:00
committed by GitHub
parent 16cdc741cf
commit dc037f8d41
16 changed files with 44 additions and 289 deletions

View File

@@ -6,7 +6,6 @@
#include "CommandTestBase.h"
#include "frc2/command/ConditionalCommand.h"
#include "frc2/command/EndlessCommand.h"
#include "frc2/command/FunctionalCommand.h"
#include "frc2/command/InstantCommand.h"
#include "frc2/command/ParallelRaceGroup.h"
@@ -120,19 +119,6 @@ TEST_F(CommandDecoratorTest, Perpetually) {
EXPECT_TRUE(scheduler.IsScheduled(&command));
}
TEST_F(CommandDecoratorTest, Endlessly) {
CommandScheduler scheduler = GetScheduler();
auto command = InstantCommand([] {}, {}).Endlessly();
scheduler.Schedule(command);
scheduler.Run();
scheduler.Run();
EXPECT_TRUE(scheduler.IsScheduled(command));
}
TEST_F(CommandDecoratorTest, Unless) {
CommandScheduler scheduler = GetScheduler();

View File

@@ -1,22 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "CommandTestBase.h"
#include "frc2/command/InstantCommand.h"
using namespace frc2;
class EndlessCommandTest : public CommandTestBase {};
TEST_F(EndlessCommandTest, EndlessCommandSchedule) {
CommandScheduler scheduler = GetScheduler();
bool check = false;
auto command = InstantCommand([&check] { check = true; }, {}).Endlessly();
scheduler.Schedule(command);
scheduler.Run();
EXPECT_TRUE(scheduler.IsScheduled(command));
EXPECT_TRUE(check);
}