umbrello
2.32.2
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
Go to the documentation of this file.
30 #define QCOMPARE(actual, expected) \
31 QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__)
33 #define QVERIFY(statement) \
34 QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)
37 #define IS_NOT_IMPL() QSKIP("not implemented yet", SkipSingle)
51 explicit TestBase(QObject *parent = 0);
81 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
91 _state = _o->blockSignals(
true);
97 _state = _o->blockSignals(
true);
102 _o->blockSignals(_state);
110 #include <QSignalBlocker>
126 #include <QDomDocument>
127 #include <QXmlStreamWriter>
134 template <
class T,
typename N>
143 void testDump(
const QString &title = QString());
147 template <
class T,
typename N>
151 QXmlStreamWriter stream(&xml);
152 stream.writeStartElement(
"unittest");
153 T::saveToXMI1(stream);
154 stream.writeEndElement();
158 template <
class T,
typename N>
164 if (!qDoc.setContent(xml, &error, &line))
166 QDomElement root = qDoc.childNodes().at(0).toElement();
167 QDomElement e = root.childNodes().at(0).toElement();
168 bool result = T::loadFromXMI1(e);
171 result = T::resolveRef();
176 template <
class T,
typename N>
179 QString xml = testSave1();
180 qDebug() << title << xml;
184 template <
class T,
typename N>
187 return T::m_pSecondary.data();
193 template <
class T,
typename N>
200 void testDump(
const QString &title = QString());
203 template <
class T,
typename N>
207 QXmlStreamWriter stream(&xml);
208 stream.writeStartElement(
"unittest");
209 T::saveToXMI1(stream);
210 stream.writeEndElement();
214 template <
class T,
typename N>
220 if (!qDoc.setContent(xml, &error, &line))
222 QDomElement root = qDoc.childNodes().at(0).toElement();
223 QDomElement e = root.childNodes().at(0).toElement();
224 bool result = T::loadFromXMI1(e);
227 result = T::activate(
nullptr);
232 template <
class T,
typename N>
235 QString xml = testSave1();
236 qDebug() << title << xml;
bool _state
Definition: testbase.h:123
Definition: testbase.h:135
void testDump(const QString &title=QString())
Definition: testbase.h:177
virtual void cleanupTestCase()
Definition: testbase.cpp:55
QString temporaryPath()
Definition: testbase.cpp:86
CodeGenerationPolicy * commonPolicy() const
Definition: uml.cpp:2288
TestBase(QObject *parent=0)
Definition: testbase.cpp:43
Definition: testbase.h:70
virtual void cleanupOnExit(QObject *p)
Definition: testbase.cpp:63
QSignalBlocker SignalBlocker
Definition: testbase.h:111
virtual void initTestCase()
Definition: testbase.cpp:68
The base class for UML objects.
Definition: umlobject.h:74
bool loading() const
Definition: umldoc.cpp:1573
void setLoading(bool state=true)
Definition: umldoc.cpp:1582
void setActiveLanguage(Uml::ProgrammingLanguage::Enum pl)
Definition: uml.cpp:2528
@ Cpp
Definition: basictypes.h:325
QList< QPointer< QObject > > m_objectsToDelete
Definition: testbase.h:59
static UMLApp * app()
Definition: uml.cpp:280
QString testSave1()
Definition: testbase.h:148
void setOutputDirectory(QDir new_var)
Definition: codegenerationpolicy.cpp:201
SetLoading()
Definition: testbase.cpp:91
bool testLoad1(const QString &xml)
Definition: testbase.h:159
QString m_tempPath
holds path to temporary directory
Definition: testbase.h:77
Definition: umlscene.h:69
Definition: testbase.h:117
Definition: testbase.h:47
UMLObject * secondary() const
Definition: testbase.h:185
virtual void initTestCase()
Definition: testbase.cpp:48
UMLDoc * document() const
Definition: uml.cpp:1068
~SetLoading()
Definition: testbase.cpp:97