Make ChoiceQueue use smart pointers.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -25,20 +25,16 @@ TEST_CASE("Move creature choice up next.", "[Battling]") {
|
||||
|
||||
auto choiceQueue = ChoiceQueue(choices);
|
||||
CHECK(choiceQueue.MoveCreatureChoiceNext(c4));
|
||||
auto currentChoices = choiceQueue.GetInnerQueue();
|
||||
auto& currentChoices = choiceQueue.GetInnerQueue();
|
||||
CHECK(currentChoices[0]->GetUser() == c4);
|
||||
CHECK(currentChoices[1]->GetUser() == c1);
|
||||
CHECK(currentChoices[2]->GetUser() == c2);
|
||||
CHECK(currentChoices[3]->GetUser() == c3);
|
||||
|
||||
CHECK_FALSE(choiceQueue.MoveCreatureChoiceNext(c4));
|
||||
delete choiceQueue.Dequeue();
|
||||
delete choiceQueue.Dequeue();
|
||||
choiceQueue.Dequeue();
|
||||
choiceQueue.Dequeue();
|
||||
CHECK_FALSE(choiceQueue.MoveCreatureChoiceNext(c1));
|
||||
|
||||
delete choiceQueue.Dequeue();
|
||||
delete choiceQueue.Dequeue();
|
||||
|
||||
delete c1;
|
||||
delete c2;
|
||||
delete c3;
|
||||
|
||||
Reference in New Issue
Block a user