00001 00002 #include <cxxtest/TestSuite.h> 00003 00004 #include "../../src/domain/undo/undohistory.h" 00005 #include "../../src/domain/undo/undoadd.h" 00006 00007 #include <cstring> 00008 #include <iostream> 00009 using namespace std; 00010 00011 class UndoTest : public CxxTest::TestSuite 00012 { 00013 private: 00014 00015 public: 00016 void setUp() 00017 { 00018 /*cout << ".........................................................\n......................UndoTest......................" << endl; 00019 DomainFacade::getFacade()->newProject();*/ 00020 } 00021 00022 void tearDown() 00023 { 00024 } 00025 00026 void test_undoAdd() 00027 { 00028 /*std::vector<char*> frames; 00029 frames.push_back("/home/fredrik/2005-hig-stopmotion/implementation/stopmotion/testsuite/unittests/frame1.png"); 00030 00031 DomainFacade::getFacade()->addFrames(frames); 00032 00033 frames.pop_back(); 00034 frames.push_back("/home/fredrik/2005-hig-stopmotion/implementation/stopmotion/testsuite/unittests/frame2.png"); 00035 00036 DomainFacade::getFacade()->addFrames(frames); 00037 00038 DomainFacade::getFacade()->undo(); 00039 00040 00041 TS_ASSERT_EQUALS( DomainFacade::getFacade()->getModelSize(), 1 ); 00042 00043 DomainFacade::getFacade()->redo(); 00044 00045 TS_ASSERT_EQUALS( DomainFacade::getFacade()->getModelSize(), 2 ); 00046 TS_ASSERT( strstr(DomainFacade::getFacade()->getFrame( DomainFacade::getFacade()->getActiveFrameNumber() )->getImagePath(), "tmp_1") != NULL ); 00047 00048 00049 DomainFacade::getFacade()->newProject();*/ 00050 } 00051 };