1 /* 2 * Copyright (c) 2011 Dmitry Kazakov <dimula73@gmail.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __KIS_DUMMIES_FACADE_BASE_TEST_H 20 #define __KIS_DUMMIES_FACADE_BASE_TEST_H 21 22 #include <QtTest> 23 24 #include "empty_nodes_test.h" 25 26 class KisNodeDummy; 27 class KisDummiesFacadeBase; 28 29 class KisDummiesFacadeBaseTest : public QObject, public TestUtil::EmptyNodesTest 30 { 31 Q_OBJECT 32 33 protected: 34 virtual KisDummiesFacadeBase* dummiesFacadeFactory() = 0; 35 virtual void destroyDummiesFacade(KisDummiesFacadeBase *dummiesFacade) = 0; 36 37 private Q_SLOTS: 38 void slotNodeActivated(KisNodeSP node); 39 void slotEndInsertDummy(KisNodeDummy *dummy); 40 void slotBeginRemoveDummy(KisNodeDummy *dummy); 41 42 private Q_SLOTS: 43 void init(); 44 void cleanup(); 45 46 void testSetImage(); 47 void testAddNode(); 48 void testRemoveNode(); 49 void testMoveNodeSameParent(); 50 void testMoveNodeDifferentParent(); 51 void testSubstituteRootNode(); 52 void testAddSelectionMasksNoActivation(); 53 54 private: 55 56 void verifyActivatedNodes(const QString &nodes); 57 void verifyMovedDummies(const QString &nodes); 58 59 private: 60 KisDummiesFacadeBase *m_dummiesFacade; 61 62 QString m_activatedNodes; 63 QString m_movedDummies; 64 }; 65 66 #endif /* __KIS_DUMMIES_FACADE_BASE_TEST_H */ 67