- File:
-
- 1 edited
-
src/unittests/ActionSequenceTest.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/ActionSequenceTest.cpp
r80951de rec149d 17 17 #include "Actions/ActionRegistry.hpp" 18 18 19 #include "DummyUI.hpp" 20 19 21 #ifdef HAVE_TESTRUNNER 20 22 #include "UnitTestMain.hpp" … … 33 35 virtual ~canUndoActionStub(){} 34 36 35 virtual Dialog* createDialog(){ 36 return NULL; 37 virtual Dialog* fillDialog(Dialog *dialog){ 38 ASSERT(dialog,"No Dialog given when filling action dialog"); 39 return dialog; 37 40 } 38 41 … … 60 63 virtual ~cannotUndoActionStub(){} 61 64 62 virtual Dialog* createDialog(){ 63 return NULL; 65 virtual Dialog* fillDialog(Dialog *dialog){ 66 ASSERT(dialog,"No Dialog given when filling action dialog"); 67 return dialog; 64 68 } 65 69 … … 90 94 virtual ~wasCalledActionStub(){} 91 95 92 virtual Dialog* createDialog(){93 return NULL;96 virtual Dialog* fillDialog(Dialog *dialog){ 97 return dialog; 94 98 } 95 99 virtual Action::state_ptr performCall(){ … … 119 123 120 124 void ActionSequenceTest::setUp(){ 125 static bool hasDescriptor = false; 121 126 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"); 122 133 // create some necessary stubs used in this test 123 134 positive1 = new canUndoActionStub(); … … 146 157 ActionHistory::purgeInstance(); 147 158 ActionRegistry::purgeInstance(); 159 UIFactory::purgeInstance(); 148 160 } 149 161 … … 231 243 232 244 CPPUNIT_ASSERT_EQUAL(true,wasCalled1->wasCalled()); 233 CPPUNIT_ASSERT_EQUAL(true,wasCalled 1->wasCalled());245 CPPUNIT_ASSERT_EQUAL(true,wasCalled2->wasCalled()); 234 246 235 247 ActionHistory::getInstance().undoLast(); 236 248 237 249 CPPUNIT_ASSERT_EQUAL(false,wasCalled1->wasCalled()); 238 CPPUNIT_ASSERT_EQUAL(false,wasCalled 1->wasCalled());239 240 } 241 242 250 CPPUNIT_ASSERT_EQUAL(false,wasCalled2->wasCalled()); 251 252 } 253 254
Note:
See TracChangeset
for help on using the changeset viewer.
