diff --git a/test/test.cpp b/test/test.cpp index 29ccbbe..670db3b 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -3,6 +3,7 @@ #include "unitv.h" #include "board.h" #include "orders.h" +#include "game.h" const char* tests() { @@ -18,6 +19,13 @@ const char* tests() return "failed to properly create V unit"; } + { + CUnitV myV; + CUnitV myV2; + if( myV.getID() == myV2.getID() ) + return "Unit IDs the same"; + } + { std::unique_ptr myV = CUnit::getUnitFromVis('v'); if( myV->getVisual() != 'v' ) @@ -55,6 +63,18 @@ const char* tests() return "Wrongly detected an movement order"; } + { + CTTRTSGame game( 15, 10 ); + if( game.SimulateToNextTurn() ) + return "Failed to simulate a blank game"; + + if( game.GetNumOrders() ) + return "Game started with non-zero order number"; + + if( game.GetNumUnits() ) + return "Game started with non-zero unit number"; + } + return nullptr; }