umbrello
2.35.1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
Go to the documentation of this file.
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>
120 template <
class T,
typename N>
129 void testDump(
const QString &title = QString());
133 template <
class T,
typename N>
137 QXmlStreamWriter stream(&xml);
138 stream.writeStartElement(
"unittest");
139 T::saveToXMI(stream);
140 stream.writeEndElement();
144 template <
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();
162 template <
class T,
typename N>
165 QString xml = testSave1();
166 qDebug() << title << xml;
170 template <
class T,
typename N>
173 return T::m_pSecondary.data();
179 template <
class T,
typename N>
186 void testDump(
const QString &title = QString());
189 template <
class T,
typename N>
193 QXmlStreamWriter stream(&xml);
194 stream.writeStartElement(
"unittest");
195 T::saveToXMI(stream);
196 stream.writeEndElement();
200 template <
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);
218 template <
class T,
typename N>
221 QString xml = testSave1();
222 qDebug() << title << xml;
bool _state
Definition: testbase.h:109
GNU GENERAL PUBLIC LICENSE June Free Software Inc Franklin Fifth USA Everyone is permitted to copy and distribute verbatim copies of this license document
Definition: GPL-2.0-only.txt:8
Definition: testbase.h:121
void testDump(const QString &title=QString())
Definition: testbase.h:163
virtual void cleanupTestCase()
Definition: testbase.cpp:42
QString temporaryPath()
Definition: testbase.cpp:73
CodeGenerationPolicy * commonPolicy() const
Definition: uml.cpp:2459
TestBase(QObject *parent=0)
Definition: testbase.cpp:29
Definition: testbase.h:56
virtual void cleanupOnExit(QObject *p)
Definition: testbase.cpp:50
QSignalBlocker SignalBlocker
Definition: testbase.h:97
virtual void initTestCase()
Definition: testbase.cpp:55
void setup()
Definition: uml.cpp:252
The base class for UML objects.
Definition: umlobject.h:69
bool loading() const
Definition: umldoc.cpp:1628
void setLoading(bool state=true)
Definition: umldoc.cpp:1637
void setActiveLanguage(Uml::ProgrammingLanguage::Enum pl)
Definition: uml.cpp:2699
@ Cpp
Definition: basictypes.h:294
QList< QPointer< QObject > > m_objectsToDelete
Definition: testbase.h:45
static UMLApp * app()
Definition: uml.cpp:349
QString testSave1()
Definition: testbase.h:134
void setOutputDirectory(QDir new_var)
Definition: codegenerationpolicy.cpp:197
SetLoading()
Definition: testbase.cpp:78
bool testLoad1(const QString &xml)
Definition: testbase.h:145
QString m_tempPath
holds path to temporary directory
Definition: testbase.h:63
Definition: umlscene.h:64
Definition: testbase.h:103
Definition: testbase.h:33
UMLObject * secondary() const
Definition: testbase.h:171
virtual void initTestCase()
Definition: testbase.cpp:34
UMLDoc * document() const
Definition: uml.cpp:1139
~SetLoading()
Definition: testbase.cpp:84