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#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
77 _state = _o->blockSignals(
true);
83 _state = _o->blockSignals(
true);
88 _o->blockSignals(_state);
96#include <QSignalBlocker>
112#include <QDomDocument>
113#include <QXmlStreamWriter>
120template <
class T,
typename N>
129 void testDump(
const QString &title = QString());
133template <
class T,
typename N>
137 QXmlStreamWriter stream(&xml);
138 stream.writeStartElement(
"unittest");
139 T::saveToXMI(stream);
140 stream.writeEndElement();
144template <
class T,
typename N>
150 if (!qDoc.setContent(xml, &error, &line))
152 QDomElement root = qDoc.childNodes().at(0).toElement();
153 QDomElement e = root.childNodes().at(0).toElement();
154 bool result = T::loadFromXMI(e);
157 result = T::resolveRef();
162template <
class T,
typename N>
165 QString xml = testSave1();
166 qDebug() << title << xml;
170template <
class T,
typename N>
173 return T::m_pSecondary.data();
179template <
class T,
typename N>
186 void testDump(
const QString &title = QString());
189template <
class T,
typename N>
193 QXmlStreamWriter stream(&xml);
194 stream.writeStartElement(
"unittest");
195 T::saveToXMI(stream);
196 stream.writeEndElement();
200template <
class T,
typename N>
206 if (!qDoc.setContent(xml, &error, &line))
208 QDomElement root = qDoc.childNodes().at(0).toElement();
209 QDomElement e = root.childNodes().at(0).toElement();
210 bool result = T::loadFromXMI(e);
213 result = T::activate(
nullptr);
218template <
class T,
typename N>
221 QString xml = testSave1();
222 qDebug() << title << xml;
Definition: testbase.h:104
SetLoading()
Definition: testbase.cpp:78
~SetLoading()
Definition: testbase.cpp:84
bool _state
Definition: testbase.h:109
Definition: testbase.h:34
virtual void initTestCase()
Definition: testbase.cpp:34
virtual void cleanupOnExit(QObject *p)
Definition: testbase.cpp:50
TestBase(QObject *parent=0)
Definition: testbase.cpp:29
virtual void cleanupTestCase()
Definition: testbase.cpp:42
QList< QPointer< QObject > > m_objectsToDelete
Definition: testbase.h:45
Definition: testbase.h:57
virtual void initTestCase()
Definition: testbase.cpp:55
QString temporaryPath()
Definition: testbase.cpp:73
QString m_tempPath
holds path to temporary directory
Definition: testbase.h:63
Definition: testbase.h:122
QString testSave1()
Definition: testbase.h:134
UMLObject * secondary() const
Definition: testbase.h:171
void testDump(const QString &title=QString())
Definition: testbase.h:163
bool testLoad1(const QString &xml)
Definition: testbase.h:145
static UMLApp * app()
Definition: uml.cpp:349
The base class for UML objects.
Definition: umlobject.h:70
Definition: umlscene.h:65
QSignalBlocker SignalBlocker
Definition: testbase.h:97