[commands] Fix RepeatCommand calling end() twice (#5261)

This commit is contained in:
Joseph Eng
2023-04-28 20:57:33 -07:00
committed by GitHub
parent 9cbeb841f5
commit 40ca094686
4 changed files with 82 additions and 44 deletions

View File

@@ -60,6 +60,19 @@ TEST_F(RepeatCommandTest, CallsMethodsCorrectly) {
EXPECT_EQ(3, exeCounter);
EXPECT_EQ(3, isFinishedCounter);
EXPECT_EQ(1, endCounter);
isFinishedHook = true;
scheduler.Run();
EXPECT_EQ(2, initCounter);
EXPECT_EQ(4, exeCounter);
EXPECT_EQ(4, isFinishedCounter);
EXPECT_EQ(2, endCounter);
command.Cancel();
EXPECT_EQ(2, initCounter);
EXPECT_EQ(4, exeCounter);
EXPECT_EQ(4, isFinishedCounter);
EXPECT_EQ(2, endCounter);
}
INSTANTIATE_SINGLE_COMMAND_COMPOSITION_TEST_SUITE(RepeatCommandTest,