mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fix internal deprecation warnings (#4257)
This allows us to error out on deprecation warnings for thirdparty libraries and standard library features. Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "CommandTestBase.h"
|
||||
#include "frc2/command/ConditionalCommand.h"
|
||||
#include "frc2/command/EndlessCommand.h"
|
||||
#include "frc2/command/InstantCommand.h"
|
||||
#include "frc2/command/ParallelRaceGroup.h"
|
||||
#include "frc2/command/PerpetualCommand.h"
|
||||
@@ -93,7 +94,22 @@ TEST_F(CommandDecoratorTest, AndThen) {
|
||||
TEST_F(CommandDecoratorTest, Perpetually) {
|
||||
CommandScheduler scheduler = GetScheduler();
|
||||
|
||||
WPI_IGNORE_DEPRECATED
|
||||
auto command = InstantCommand([] {}, {}).Perpetually();
|
||||
WPI_UNIGNORE_DEPRECATED
|
||||
|
||||
scheduler.Schedule(&command);
|
||||
|
||||
scheduler.Run();
|
||||
scheduler.Run();
|
||||
|
||||
EXPECT_TRUE(scheduler.IsScheduled(&command));
|
||||
}
|
||||
|
||||
TEST_F(CommandDecoratorTest, Endlessly) {
|
||||
CommandScheduler scheduler = GetScheduler();
|
||||
|
||||
auto command = InstantCommand([] {}, {}).Endlessly();
|
||||
|
||||
scheduler.Schedule(&command);
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// 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/EndlessCommand.h"
|
||||
#include "frc2/command/InstantCommand.h"
|
||||
|
||||
using namespace frc2;
|
||||
class EndlessCommandTest : public CommandTestBase {};
|
||||
|
||||
TEST_F(EndlessCommandTest, EndlessCommandSchedule) {
|
||||
CommandScheduler scheduler = GetScheduler();
|
||||
|
||||
bool check = false;
|
||||
|
||||
EndlessCommand command{InstantCommand([&check] { check = true; }, {})};
|
||||
|
||||
scheduler.Schedule(&command);
|
||||
scheduler.Run();
|
||||
EXPECT_TRUE(scheduler.IsScheduled(&command));
|
||||
EXPECT_TRUE(check);
|
||||
}
|
||||
@@ -14,7 +14,9 @@ TEST_F(PerpetualCommandTest, PerpetualCommandSchedule) {
|
||||
|
||||
bool check = false;
|
||||
|
||||
WPI_IGNORE_DEPRECATED
|
||||
PerpetualCommand command{InstantCommand([&check] { check = true; }, {})};
|
||||
WPI_UNIGNORE_DEPRECATED
|
||||
|
||||
scheduler.Schedule(&command);
|
||||
scheduler.Run();
|
||||
|
||||
Reference in New Issue
Block a user