- File:
-
- 1 edited
-
src/unittests/ActionSequenceTest.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/ActionSequenceTest.cpp
rec149d r80951de 17 17 #include "Actions/ActionRegistry.hpp" 18 18 19 #include "DummyUI.hpp"20 21 19 #ifdef HAVE_TESTRUNNER 22 20 #include "UnitTestMain.hpp" … … 35 33 virtual ~canUndoActionStub(){} 36 34 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; 40 37 } 41 38 … … 63 60 virtual ~cannotUndoActionStub(){} 64 61 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; 68 64 } 69 65 … … 94 90 virtual ~wasCalledActionStub(){} 95 91 96 virtual Dialog* fillDialog(Dialog *dialog){97 return dialog;92 virtual Dialog* createDialog(){ 93 return NULL; 98 94 } 99 95 virtual Action::state_ptr performCall(){ … … 123 119 124 120 void ActionSequenceTest::setUp(){ 125 static bool hasDescriptor = false;126 121 ActionHistory::init(); 127 // TODO: find a way to really reset the factory to a clean state in tear-down128 if(!hasDescriptor){129 UIFactory::registerFactory(new DummyUIFactory::description());130 hasDescriptor = true;131 }132 UIFactory::makeUserInterface("Dummy");133 122 // create some necessary stubs used in this test 134 123 positive1 = new canUndoActionStub(); … … 157 146 ActionHistory::purgeInstance(); 158 147 ActionRegistry::purgeInstance(); 159 UIFactory::purgeInstance();160 148 } 161 149 … … 243 231 244 232 CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled()); 245 CPPUNIT_ASSERT_EQUAL(true,wasCalled 2->wasCalled());233 CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled()); 246 234 247 235 ActionHistory::getInstance().undoLast(); 248 236 249 237 CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled()); 250 CPPUNIT_ASSERT_EQUAL(false,wasCalled 2->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.
