Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/ActionSequenceTest.cpp

    rec149d r80951de  
    1717#include "Actions/ActionRegistry.hpp"
    1818
    19 #include "DummyUI.hpp"
    20 
    2119#ifdef HAVE_TESTRUNNER
    2220#include "UnitTestMain.hpp"
     
    3533  virtual ~canUndoActionStub(){}
    3634
    37   virtual Dialog* fillDialog(Dialog *dialog){
    38     ASSERT(dialog,"No Dialog given when filling action dialog");
    39     return dialog;
     35  virtual Dialog* createDialog(){
     36    return NULL;
    4037  }
    4138
     
    6360  virtual ~cannotUndoActionStub(){}
    6461
    65   virtual Dialog* fillDialog(Dialog *dialog){
    66     ASSERT(dialog,"No Dialog given when filling action dialog");
    67     return dialog;
     62  virtual Dialog* createDialog(){
     63    return NULL;
    6864  }
    6965
     
    9490  virtual ~wasCalledActionStub(){}
    9591
    96   virtual Dialog* fillDialog(Dialog *dialog){
    97     return dialog;
     92  virtual Dialog* createDialog(){
     93    return NULL;
    9894  }
    9995  virtual Action::state_ptr performCall(){
     
    123119
    124120void ActionSequenceTest::setUp(){
    125   static bool hasDescriptor = false;
    126121  ActionHistory::init();
    127   // TODO: find a way to really reset the factory to a clean state in tear-down
    128   if(!hasDescriptor){
    129     UIFactory::registerFactory(new DummyUIFactory::description());
    130     hasDescriptor = true;
    131   }
    132   UIFactory::makeUserInterface("Dummy");
    133122  // create some necessary stubs used in this test
    134123  positive1 = new canUndoActionStub();
     
    157146  ActionHistory::purgeInstance();
    158147  ActionRegistry::purgeInstance();
    159   UIFactory::purgeInstance();
    160148}
    161149
     
    243231
    244232  CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled());
    245   CPPUNIT_ASSERT_EQUAL(true,wasCalled2->wasCalled());
     233  CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled());
    246234
    247235  ActionHistory::getInstance().undoLast();
    248236
    249237  CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled());
    250   CPPUNIT_ASSERT_EQUAL(false,wasCalled2->wasCalled());
    251 
    252 }
    253 
    254 
     238  CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled());
     239
     240}
     241
     242
Note: See TracChangeset for help on using the changeset viewer.