mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Remove EndlessCommand (#4483)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user