- File:
-
- 1 edited
-
src/unittests/atomsCalculationTest.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/atomsCalculationTest.cpp
re73a8a2 r57adc7 23 23 #include "World_calculations.hpp" 24 24 #include "atom.hpp" 25 26 #ifdef HAVE_TESTRUNNER27 #include "UnitTestMain.hpp"28 #endif /*HAVE_TESTRUNNER*/29 25 30 26 // Registers the fixture into the 'registry' … … 55 51 // set up and tear down 56 52 void atomsCalculationTest::setUp(){ 57 World::get Instance();53 World::get(); 58 54 for(int i=0;i<ATOM_COUNT;++i){ 59 55 atoms[i]= new AtomStub(i); 60 World::get Instance().registerAtom(atoms[i]);56 World::get()->registerAtom(atoms[i]); 61 57 } 62 58 } 63 59 void atomsCalculationTest::tearDown(){ 64 World:: purgeInstance();65 ActionRegistry::purge Instance();60 World::destroy(); 61 ActionRegistry::purgeRegistry(); 66 62 } 67 63 … … 96 92 } 97 93 94 static void operation(atom* _atom){ 95 AtomStub *atom = dynamic_cast<AtomStub*>(_atom); 96 assert(atom); 97 atom->doSomething(); 98 } 99 100 98 101 void atomsCalculationTest::testCalculateSimple(){ 99 AtomsCalculation<int> *calc = World::get Instance().calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms());102 AtomsCalculation<int> *calc = World::get()->calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms()); 100 103 std::vector<int> allIds = (*calc)(); 101 104 CPPUNIT_ASSERT(hasAll(allIds,0,ATOM_COUNT)); … … 105 108 void atomsCalculationTest::testCalculateExcluded(){ 106 109 int excluded = ATOM_COUNT/2; 107 AtomsCalculation<int> *calc = World::get Instance().calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms() && !AtomById(excluded));110 AtomsCalculation<int> *calc = World::get()->calcOnAtoms<int>(boost::bind(&atom::getId,_1),"FOO",AllAtoms() && !AtomById(excluded)); 108 111 std::vector<int> allIds = (*calc)(); 109 112 std::set<int> excluded_set;
Note:
See TracChangeset
for help on using the changeset viewer.
