diff --git a/wpilibNewCommands/src/test/native/cpp/frc2/command/ConditionalCommandTest.cpp b/wpilibNewCommands/src/test/native/cpp/frc2/command/ConditionalCommandTest.cpp index 90fb4adcf4e..f7545f813f4 100644 --- a/wpilibNewCommands/src/test/native/cpp/frc2/command/ConditionalCommandTest.cpp +++ b/wpilibNewCommands/src/test/native/cpp/frc2/command/ConditionalCommandTest.cpp @@ -56,35 +56,35 @@ TEST_F(ConditionalCommandTest, ConditionalCommandRequirement) { } TEST_F(ConditionalCommandTest, AllTrue) { - CommandPtr command = cmd::Either(cmd::Run([] {}, {}).IgnoringDisable(true), - cmd::Run([] {}, {}).IgnoringDisable(true), + auto command = cmd::Either(cmd::Idle().IgnoringDisable(true), + cmd::Idle().IgnoringDisable(true), [] { return true; }); EXPECT_EQ(true, command.get()->RunsWhenDisabled()); } TEST_F(ConditionalCommandTest, AllFalse) { - CommandPtr command = cmd::Either(cmd::Run([] {}, {}).IgnoringDisable(false), - cmd::Run([] {}, {}).IgnoringDisable(false), + auto command = cmd::Either(cmd::Idle().IgnoringDisable(false), + cmd::Idle().IgnoringDisable(false), [] { return true; }); EXPECT_EQ(false, command.get()->RunsWhenDisabled()); } TEST_F(ConditionalCommandTest, OneTrueOneFalse) { - CommandPtr command = cmd::Either(cmd::Run([] {}, {}).IgnoringDisable(true), - cmd::Run([] {}, {}).IgnoringDisable(false), + auto command = cmd::Either(cmd::Idle().IgnoringDisable(true), + cmd::Idle().IgnoringDisable(false), [] { return true; }); EXPECT_EQ(false, command.get()->RunsWhenDisabled()); } TEST_F(ConditionalCommandTest, TwoFalseOneTrue) { - CommandPtr command = cmd::Either(cmd::Run([] {}, {}).IgnoringDisable(false), - cmd::Run([] {}, {}).IgnoringDisable(true), + auto command = cmd::Either(cmd::Idle().IgnoringDisable(false), + cmd::Idle().IgnoringDisable(true), [] { return true; }); EXPECT_EQ(false, command.get()->RunsWhenDisabled()); } TEST_F(ConditionalCommandTest, AllCancelSelf) { - CommandPtr command = cmd::Either( + auto command = cmd::Either( cmd::WaitUntil([] { return false; }).WithInterruptBehavior(Command::InterruptionBehavior::kCancelSelf), @@ -97,10 +97,10 @@ TEST_F(ConditionalCommandTest, AllCancelSelf) { } TEST_F(ConditionalCommandTest, AllCancelIncoming) { - CommandPtr command = - cmd::Either(cmd::Run([] {}, {}).WithInterruptBehavior( + auto command = + cmd::Either(cmd::Idle().WithInterruptBehavior( Command::InterruptionBehavior::kCancelIncoming), - cmd::Run([] {}, {}).WithInterruptBehavior( + cmd::Idle().WithInterruptBehavior( Command::InterruptionBehavior::kCancelIncoming), [] { return false; }); EXPECT_EQ(Command::InterruptionBehavior::kCancelIncoming, @@ -108,10 +108,10 @@ TEST_F(ConditionalCommandTest, AllCancelIncoming) { } TEST_F(ConditionalCommandTest, OneCancelSelfOneIncoming) { - CommandPtr command = - cmd::Either(cmd::Run([] {}, {}).WithInterruptBehavior( + auto command = + cmd::Either(cmd::Idle().WithInterruptBehavior( Command::InterruptionBehavior::kCancelSelf), - cmd::Run([] {}, {}).WithInterruptBehavior( + cmd::Idle().WithInterruptBehavior( Command::InterruptionBehavior::kCancelIncoming), [] { return false; }); EXPECT_EQ(Command::InterruptionBehavior::kCancelSelf, @@ -119,10 +119,10 @@ TEST_F(ConditionalCommandTest, OneCancelSelfOneIncoming) { } TEST_F(ConditionalCommandTest, OneCancelIncomingOneSelf) { - CommandPtr command = - cmd::Either(cmd::Run([] {}, {}).WithInterruptBehavior( + auto command = + cmd::Either(cmd::Idle().WithInterruptBehavior( Command::InterruptionBehavior::kCancelIncoming), - cmd::Run([] {}, {}).WithInterruptBehavior( + cmd::Idle().WithInterruptBehavior( Command::InterruptionBehavior::kCancelSelf), [] { return false; }); EXPECT_EQ(Command::InterruptionBehavior::kCancelSelf, diff --git a/wpilibNewCommands/src/test/native/cpp/frc2/command/DefaultCommandTest.cpp b/wpilibNewCommands/src/test/native/cpp/frc2/command/DefaultCommandTest.cpp index 650db1f9152..bcf2aed5b68 100644 --- a/wpilibNewCommands/src/test/native/cpp/frc2/command/DefaultCommandTest.cpp +++ b/wpilibNewCommands/src/test/native/cpp/frc2/command/DefaultCommandTest.cpp @@ -16,7 +16,7 @@ TEST_F(DefaultCommandTest, DefaultCommandSchedule) { TestSubsystem subsystem; - auto command = cmd::Run([] {}, {&subsystem}); + auto command = cmd::Idle({&subsystem}); scheduler.SetDefaultCommand(&subsystem, std::move(command)); auto handle = scheduler.GetDefaultCommand(&subsystem); @@ -30,8 +30,8 @@ TEST_F(DefaultCommandTest, DefaultCommandInterruptResume) { TestSubsystem subsystem; - auto command1 = cmd::Run([] {}, {&subsystem}); - auto command2 = cmd::Run([] {}, {&subsystem}); + auto command1 = cmd::Idle({&subsystem}); + auto command2 = cmd::Idle({&subsystem}); scheduler.SetDefaultCommand(&subsystem, std::move(command1)); auto handle = scheduler.GetDefaultCommand(&subsystem); diff --git a/wpilibNewCommands/src/test/native/cpp/frc2/command/SequentialCommandGroupTest.cpp b/wpilibNewCommands/src/test/native/cpp/frc2/command/SequentialCommandGroupTest.cpp index dd3b54fed36..3781928ea64 100644 --- a/wpilibNewCommands/src/test/native/cpp/frc2/command/SequentialCommandGroupTest.cpp +++ b/wpilibNewCommands/src/test/native/cpp/frc2/command/SequentialCommandGroupTest.cpp @@ -125,13 +125,10 @@ TEST_F(SequentialCommandGroupTest, SequentialGroupRequirement) { TestSubsystem requirement4; auto command1 = cmd::RunOnce([] {}, {&requirement1, &requirement2}); - // InstantCommand command1([] {}, {&requirement1, &requirement2}); auto command2 = cmd::RunOnce([] {}, {&requirement3}); auto command3 = cmd::RunOnce([] {}, {&requirement3, &requirement4}); - // SequentialCommandGroup group(std::move(command1), std::move(command2)); - auto group = cmd::Sequence( - make_vector(std::move(command1), std::move(command2))); + auto group = cmd::Sequence(std::move(command1), std::move(command2)); scheduler.Schedule(group); scheduler.Schedule(command3);