From 5e950528c12274ca789547527a9deddf589030a8 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Tue, 16 Dec 2014 13:13:00 +0000 Subject: [PATCH] Even more tests --- test/test.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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; }