jumptest.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  ***************************************************************************/
00009 
00010 #include <iostream>
00011 
00012 #include "../actions/jumpdrivecommand.h"
00013 #include "../loaders.h"
00014 #include "../itemrepository.h"
00015 #include "unittestutil.h"
00016 #include "../gamemap.h"
00017 
00018 
00019 void testJumpdrive() 
00020 {
00021    auto_ptr<GameMap> game ( startMap("testjump.map"));
00022    
00023    Vehicle* veh = game->getField(5,14)->vehicle;
00024    assertOrThrow( veh != NULL );
00025    assertOrThrow( veh->damage == 0 );
00026    
00027    JumpDriveCommand* jdc = new JumpDriveCommand( veh );
00028    
00029    jdc->setDestination( MapCoordinate( 5, 4));
00030    ActionResult res = jdc->execute( createTestingContext( game.get() ));
00031    
00032    assertOrThrow( veh->attacked );
00033    assertOrThrow( veh->damage > 0 );
00034    
00035 }
00036 

Generated on Mon May 21 01:26:34 2012 for Advanced Strategic Command by  doxygen 1.5.1