16 #define QCOMPARE(actual, expected) \ 17 QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__) 19 #define QVERIFY(statement) \ 20 QTest::qVerify((statement), #statement, "", __FILE__, __LINE__) 23 #define IS_NOT_IMPL() QSKIP("not implemented yet", SkipSingle) 37 explicit TestBase(QObject *parent =
nullptr);
68 #include <QSignalBlocker> 83 #include <QDomDocument> 84 #include <QXmlStreamWriter> 91 template <
class T,
typename N>
100 void testDump(
const QString &title = QString());
104 template <
class T,
typename N>
108 QXmlStreamWriter stream(&xml);
109 stream.writeStartElement(
"unittest");
110 T::saveToXMI(stream);
111 stream.writeEndElement();
115 template <
class T,
typename N>
121 if (!qDoc.setContent(xml, &error, &line))
123 QDomElement root = qDoc.childNodes().at(0).toElement();
124 QDomElement e = root.childNodes().at(0).toElement();
125 bool result = T::loadFromXMI(e);
128 result = T::resolveRef();
133 template <
class T,
typename N>
136 QString xml = testSave1();
137 qDebug() << title << xml;
141 template <
class T,
typename N>
144 return T::m_pSecondary.data();
150 template <
class T,
typename N>
157 void testDump(
const QString &title = QString());
160 template <
class T,
typename N>
164 QXmlStreamWriter stream(&xml);
165 stream.writeStartElement(
"unittest");
166 T::saveToXMI(stream);
167 stream.writeEndElement();
171 template <
class T,
typename N>
177 if (!qDoc.setContent(xml, &error, &line))
179 QDomElement root = qDoc.childNodes().at(0).toElement();
180 QDomElement e = root.childNodes().at(0).toElement();
181 bool result = T::loadFromXMI(e);
184 result = T::activate(
nullptr);
189 template <
class T,
typename N>
192 QString xml = testSave1();
193 qDebug() << title << xml;
QWidget * m_mainWidget
Definition: testbase.h:46
virtual void initTestCase()
Definition: testbase.cpp:40
TestUML(N p1, UMLObject *p2, UMLObject *p3)
Definition: testbase.h:97
UMLObject * secondary() const
Definition: testbase.h:142
TestBase(QObject *parent=nullptr)
Definition: testbase.cpp:35
virtual void cleanupTestCase()
Definition: testbase.cpp:59
static UMLApp * app()
Definition: umlapp.cpp:284
Definition: testbase.h:57
virtual void initTestCase()
Definition: testbase.cpp:75
void testDump(const QString &title=QString())
Definition: testbase.h:134
QSignalBlocker SignalBlocker
Definition: testbase.h:69
Definition: testbase.h:92
The base class for UML objects.
Definition: umlobject.h:69
virtual void cleanupOnExit(QObject *p)
Definition: testbase.cpp:70
TestUML(N name)
Definition: testbase.h:96
Definition: testbase.h:74
Definition: testbase.h:33
QString temporaryPath()
Definition: testbase.cpp:88
bool testLoad1(const QString &xml)
Definition: testbase.h:116
QList< QPointer< QObject > > m_objectsToDelete
Definition: testbase.h:45
QString m_tempPath
holds path to temporary directory
Definition: testbase.h:64
QString testSave1()
Definition: testbase.h:105
SetLoading()
Definition: testbase.cpp:93
~SetLoading()
Definition: testbase.cpp:99
TestUML()
Definition: testbase.h:95
Definition: umlscene.h:65
bool _state
Definition: testbase.h:80