- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/manipulateAtomsTest.cpp
rcd5047 r112f90 22 22 #include "World.hpp" 23 23 #include "atom.hpp" 24 25 #include "DummyUI.hpp" 24 26 25 27 #ifdef HAVE_TESTRUNNER … … 72 74 // set up and tear down 73 75 void manipulateAtomsTest::setUp(){ 76 static bool hasDescriptor = false; 74 77 ActionHistory::init(); 75 78 World::getInstance(); 79 // TODO: find a way to really reset the factory to a clean state in tear-down 80 if(!hasDescriptor){ 81 UIFactory::registerFactory(new DummyUIFactory::description()); 82 hasDescriptor = true; 83 } 84 UIFactory::makeUserInterface("Dummy"); 76 85 for(int i=0;i<ATOM_COUNT;++i){ 77 86 atoms[i]= new AtomStub(i); … … 83 92 ActionRegistry::purgeInstance(); 84 93 ActionHistory::purgeInstance(); 94 UIFactory::purgeInstance(); 85 95 } 86 96 87 97 static void operation(atom* _atom){ 88 98 AtomStub *atom = dynamic_cast<AtomStub*>(_atom); 89 assert(atom);99 CPPUNIT_ASSERT(atom); 90 100 atom->doSomething(); 91 101 } … … 100 110 AtomStub *atom; 101 111 atom = dynamic_cast<AtomStub*>(*iter); 102 assert(atom);112 CPPUNIT_ASSERT(atom); 103 113 CPPUNIT_ASSERT(atom->manipulated); 104 114 } … … 114 124 AtomStub *atom; 115 125 atom = dynamic_cast<AtomStub*>(*iter); 116 assert(atom);126 CPPUNIT_ASSERT(atom); 117 127 if(atom->getId()!=(int)ATOM_COUNT/2) 118 128 CPPUNIT_ASSERT(atom->manipulated);
Note:
See TracChangeset
for help on using the changeset viewer.