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 = 0);
67 #include <QSignalBlocker>
82 #include <QDomDocument>
83 #include <QXmlStreamWriter>
90 template <
class T,
typename N>
99 void testDump(
const QString &title = QString());
103 template <
class T,
typename N>
107 QXmlStreamWriter stream(&xml);
108 stream.writeStartElement(
"unittest");
109 T::saveToXMI(stream);
110 stream.writeEndElement();
114 template <
class T,
typename N>
120 if (!qDoc.setContent(xml, &error, &line))
122 QDomElement root = qDoc.childNodes().at(0).toElement();
123 QDomElement e = root.childNodes().at(0).toElement();
124 bool result = T::loadFromXMI(e);
127 result = T::resolveRef();
132 template <
class T,
typename N>
135 QString xml = testSave1();
136 qDebug() << title << xml;
140 template <
class T,
typename N>
143 return T::m_pSecondary.data();
149 template <
class T,
typename N>
156 void testDump(
const QString &title = QString());
159 template <
class T,
typename N>
163 QXmlStreamWriter stream(&xml);
164 stream.writeStartElement(
"unittest");
165 T::saveToXMI(stream);
166 stream.writeEndElement();
170 template <
class T,
typename N>
176 if (!qDoc.setContent(xml, &error, &line))
178 QDomElement root = qDoc.childNodes().at(0).toElement();
179 QDomElement e = root.childNodes().at(0).toElement();
180 bool result = T::loadFromXMI(e);
183 result = T::activate(
nullptr);
188 template <
class T,
typename N>
191 QString xml = testSave1();
192 qDebug() << title << xml;
Definition: testbase.h:74
SetLoading()
Definition: testbase.cpp:67
~SetLoading()
Definition: testbase.cpp:73
bool _state
Definition: testbase.h:79
Definition: testbase.h:34
virtual void initTestCase()
Definition: testbase.cpp:28
virtual void cleanupOnExit(QObject *p)
Definition: testbase.cpp:44
TestBase(QObject *parent=0)
Definition: testbase.cpp:23
virtual void cleanupTestCase()
Definition: testbase.cpp:36
QList< QPointer< QObject > > m_objectsToDelete
Definition: testbase.h:45
Definition: testbase.h:57
virtual void initTestCase()
Definition: testbase.cpp:49
QString temporaryPath()
Definition: testbase.cpp:62
QString m_tempPath
holds path to temporary directory
Definition: testbase.h:63
Definition: testbase.h:92
QString testSave1()
Definition: testbase.h:104
UMLObject * secondary() const
Definition: testbase.h:141
void testDump(const QString &title=QString())
Definition: testbase.h:133
bool testLoad1(const QString &xml)
Definition: testbase.h:115
static UMLApp * app()
Definition: uml.cpp:306
The base class for UML objects.
Definition: umlobject.h:70
Definition: umlscene.h:65
QSignalBlocker SignalBlocker
Definition: testbase.h:68