Even more tests

This commit is contained in:
Marc Di Luzio 2014-12-16 13:13:00 +00:00
parent 72b35dbc06
commit 5e950528c1

View file

@ -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<CUnit> 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;
}