Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/unittests/atomsCalculationTest.cpp

    r57adc7 re73a8a2  
    2323#include "World_calculations.hpp"
    2424#include "atom.hpp"
     25
     26#ifdef HAVE_TESTRUNNER
     27#include "UnitTestMain.hpp"
     28#endif /*HAVE_TESTRUNNER*/
    2529
    2630// Registers the fixture into the 'registry'
     
    5155// set up and tear down
    5256void atomsCalculationTest::setUp(){
    53   World::get();
     57  World::getInstance();
    5458  for(int i=0;i<ATOM_COUNT;++i){
    5559    atoms[i]= new AtomStub(i);
    56     World::get()->registerAtom(atoms[i]);
     60    World::getInstance().registerAtom(atoms[i]);
    5761  }
    5862}
    5963void atomsCalculationTest::tearDown(){
    60   World::destroy();
    61   ActionRegistry::purgeRegistry();
     64  World::purgeInstance();
     65  ActionRegistry::purgeInstance();
    6266}
    6367
     
    9296}
    9397
    94 static void operation(atom* _atom){
    95   AtomStub *atom = dynamic_cast<AtomStub*>(_atom);
    96   assert(atom);
    97   atom->doSomething();
    98 }
    99 
    100 
    10198void atomsCalculationTest::testCalculateSimple(){
    102   AtomsCalculation<int> *calc = World::get()->calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms());
     99  AtomsCalculation<int> *calc = World::getInstance().calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms());
    103100  std::vector<int> allIds = (*calc)();
    104101  CPPUNIT_ASSERT(hasAll(allIds,0,ATOM_COUNT));
     
    108105void atomsCalculationTest::testCalculateExcluded(){
    109106  int excluded = ATOM_COUNT/2;
    110   AtomsCalculation<int> *calc = World::get()->calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms() && !AtomById(excluded));
     107  AtomsCalculation<int> *calc = World::getInstance().calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms() && !AtomById(excluded));
    111108  std::vector<int> allIds = (*calc)();
    112109  std::set<int> excluded_set;
Note: See TracChangeset for help on using the changeset viewer.