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:
Tyler Veness
2022-05-24 13:56:48 -07:00
committed by GitHub
parent b193b318c1
commit d651a1fcec
32 changed files with 165 additions and 50 deletions

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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();