Changeset 4c60ef for molecuilder/src/unittests/atomsCalculationTest.cpp
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/unittests/atomsCalculationTest.cpp
r025ca2 r4c60ef 51 51 // set up and tear down 52 52 void atomsCalculationTest::setUp(){ 53 World::get ();53 World::getInstance(); 54 54 for(int i=0;i<ATOM_COUNT;++i){ 55 55 atoms[i]= new AtomStub(i); 56 World::get ()->registerAtom(atoms[i]);56 World::getInstance().registerAtom(atoms[i]); 57 57 } 58 58 } 59 59 void atomsCalculationTest::tearDown(){ 60 World:: destroy();60 World::purgeInstance(); 61 61 ActionRegistry::purgeRegistry(); 62 62 } … … 92 92 } 93 93 94 static void operation(atom* _atom){95 AtomStub *atom = dynamic_cast<AtomStub*>(_atom);96 assert(atom);97 atom->doSomething();98 }99 100 101 94 void atomsCalculationTest::testCalculateSimple(){ 102 AtomsCalculation<int> *calc = World::get ()->calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms());95 AtomsCalculation<int> *calc = World::getInstance().calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms()); 103 96 std::vector<int> allIds = (*calc)(); 104 97 CPPUNIT_ASSERT(hasAll(allIds,0,ATOM_COUNT)); … … 108 101 void atomsCalculationTest::testCalculateExcluded(){ 109 102 int excluded = ATOM_COUNT/2; 110 AtomsCalculation<int> *calc = World::get ()->calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms() && !AtomById(excluded));103 AtomsCalculation<int> *calc = World::getInstance().calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms() && !AtomById(excluded)); 111 104 std::vector<int> allIds = (*calc)(); 112 105 std::set<int> excluded_set;
Note:
See TracChangeset
for help on using the changeset viewer.
