Even more tests
This commit is contained in:
parent
72b35dbc06
commit
5e950528c1
1 changed files with 20 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue