namelessvoid / qrwar

:european_castle: Pen&Paper like quad ruled war game.
MIT License
6 stars 0 forks source link

Make test `DeployState_Init.Then_game_objects_are_added_to_scene` order independent #110

Closed namelessvoid closed 5 years ago

namelessvoid commented 5 years ago

Unit test sometimes fails with:

Value of: qrw::g_scene.findGameObjects<qrw::DeploymentZone>()
Expected: has 2 elements where
element #0 is equal to 0x55c8ef710460,
element #1 is equal to 0x55c8ef70f520
  Actual: { 0x55c8ef70f520, 0x55c8ef710460 }, whose element #0 doesn't match
[  FAILED  ] DeployState_Init.Then_game_objects_are_added_to_scene (15 ms)

The reason is that the deployment zones are managed within a set. Therefore the assertion should not depend on their order.