Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/manipulateAtomsTest.cpp

    rcd5047 r112f90  
    2222#include "World.hpp"
    2323#include "atom.hpp"
     24
     25#include "DummyUI.hpp"
    2426
    2527#ifdef HAVE_TESTRUNNER
     
    7274// set up and tear down
    7375void manipulateAtomsTest::setUp(){
     76  static bool hasDescriptor = false;
    7477  ActionHistory::init();
    7578  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");
    7685  for(int i=0;i<ATOM_COUNT;++i){
    7786    atoms[i]= new AtomStub(i);
     
    8392  ActionRegistry::purgeInstance();
    8493  ActionHistory::purgeInstance();
     94  UIFactory::purgeInstance();
    8595}
    8696
    8797static void operation(atom* _atom){
    8898  AtomStub *atom = dynamic_cast<AtomStub*>(_atom);
    89   assert(atom);
     99  CPPUNIT_ASSERT(atom);
    90100  atom->doSomething();
    91101}
     
    100110    AtomStub *atom;
    101111    atom = dynamic_cast<AtomStub*>(*iter);
    102     assert(atom);
     112    CPPUNIT_ASSERT(atom);
    103113    CPPUNIT_ASSERT(atom->manipulated);
    104114  }
     
    114124    AtomStub *atom;
    115125    atom = dynamic_cast<AtomStub*>(*iter);
    116     assert(atom);
     126    CPPUNIT_ASSERT(atom);
    117127    if(atom->getId()!=(int)ATOM_COUNT/2)
    118128      CPPUNIT_ASSERT(atom->manipulated);
Note: See TracChangeset for help on using the changeset viewer.