1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#include "xmlelement.h"
#include <QTest>
using namespace XSD;
class XmlElementTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void constructors();
void assignment();
};
void XmlElementTest::constructors()
{
XmlElement e("ns1");
e.setName("elem");
XmlElement copy(e);
QCOMPARE(copy.name(), QString("elem"));
XmlElement moved = std::move(e);
QCOMPARE(moved.name(), QString("elem"));
}
void XmlElementTest::assignment()
{
XmlElement e("ns1");
e.setName("elem");
XmlElement copy;
copy = e;
QCOMPARE(copy.name(), QString("elem"));
XmlElement moved;
moved = std::move(e);
QCOMPARE(moved.name(), QString("elem"));
}
QTEST_MAIN(XmlElementTest)
#include "tst_xmlelement.moc"
|