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 "../gamemap.h" 00011 #include "../actions/recycleunitcommand.h" 00012 #include "../loaders.h" 00013 #include "recyclingtest.h" 00014 #include "unittestutil.h" 00015 #include "spfst.h" 00016 00017 00018 00019 void testRecycling() 00020 { 00021 auto_ptr<GameMap> game ( startMap("unittest-recycle.map")); 00022 00023 Building* bld = game->getField(5,8)->building; 00024 Vehicle* veh = getFirstCargo( bld ); 00025 assertOrThrow( veh != NULL ); 00026 assertOrThrow( bld != NULL ); 00027 00028 RecycleUnitCommand* ruc = new RecycleUnitCommand( bld ); 00029 ruc->setUnit( veh ); 00030 ActionResult res = ruc->execute( createTestingContext( game.get() )); 00031 assertOrThrow( res.successful() ); 00032 00033 }
1.5.1