File indexing completed on 2024-12-22 04:12:51

0001 /*
0002  *  SPDX-FileCopyrightText: 2011 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_DUMMIES_FACADE_BASE_TEST_H
0008 #define __KIS_DUMMIES_FACADE_BASE_TEST_H
0009 
0010 #include <simpletest.h>
0011 
0012 #include "empty_nodes_test.h"
0013 
0014 class KisNodeDummy;
0015 class KisDummiesFacadeBase;
0016 
0017 class KisDummiesFacadeBaseTest : public QObject, public TestUtil::EmptyNodesTest
0018 {
0019     Q_OBJECT
0020 
0021 protected:
0022     virtual KisDummiesFacadeBase* dummiesFacadeFactory() = 0;
0023     virtual void destroyDummiesFacade(KisDummiesFacadeBase *dummiesFacade) = 0;
0024 
0025 private Q_SLOTS:
0026     void slotNodeActivated(KisNodeSP node);
0027     void slotEndInsertDummy(KisNodeDummy *dummy);
0028     void slotBeginRemoveDummy(KisNodeDummy *dummy);
0029 
0030 private Q_SLOTS:
0031     void init();
0032     void cleanup();
0033 
0034     void testSetImage();
0035     void testAddNode();
0036     void testRemoveNode();
0037     void testMoveNodeSameParent();
0038     void testMoveNodeDifferentParent();
0039     void testSubstituteRootNode();
0040     void testAddSelectionMasksNoActivation();
0041 
0042 private:
0043 
0044     void verifyActivatedNodes(const QString &nodes);
0045     void verifyMovedDummies(const QString &nodes);
0046 
0047 private:
0048     KisDummiesFacadeBase *m_dummiesFacade;
0049 
0050     QString m_activatedNodes;
0051     QString m_movedDummies;
0052 };
0053 
0054 #endif /* __KIS_DUMMIES_FACADE_BASE_TEST_H */