diff options
author | Jyri Tahtela <jyri.tahtela@nokia.com> | 2011-05-18 07:41:09 (GMT) |
---|---|---|
committer | Jyri Tahtela <jyri.tahtela@nokia.com> | 2011-05-18 07:41:09 (GMT) |
commit | 9cacde74f7de702689725882633073e60c0a2baa (patch) | |
tree | 330d22dadbd28b14a7d8896823d1c33597e9993e /tests/auto/qxmlsimplereader | |
parent | 006c8e22075112eff6230d8168d716e44a9e29d5 (diff) | |
parent | 2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (diff) | |
download | Qt-9cacde74f7de702689725882633073e60c0a2baa.zip Qt-9cacde74f7de702689725882633073e60c0a2baa.tar.gz Qt-9cacde74f7de702689725882633073e60c0a2baa.tar.bz2 |
Merge remote-tracking branch 'qt/4.8'
Conflicts:
doc/src/examples/wheel.qdoc
src/gui/util/qflickgesture.cpp
src/gui/util/qflickgesture_p.h
src/gui/util/qscroller.cpp
src/gui/util/qscroller.h
src/gui/util/qscroller_p.h
src/gui/util/qscrollerproperties.cpp
src/gui/util/qscrollerproperties.h
tests/auto/qscroller/tst_qscroller.cpp
Diffstat (limited to 'tests/auto/qxmlsimplereader')
-rw-r--r-- | tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp index 3a4e483..f2a973c 100644 --- a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp +++ b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp @@ -165,7 +165,7 @@ class tst_QXmlSimpleReader : public QObject void roundtripWithNamespaces() const; private: - static QDomDocument fromByteArray(const QString &title, const QByteArray &ba); + static QDomDocument fromByteArray(const QString &title, const QByteArray &ba, bool *ok); XmlServer *server; }; @@ -730,25 +730,27 @@ void tst_QXmlSimpleReader::reportNamespace_data() const << QString("http://example.com/"); } -QDomDocument tst_QXmlSimpleReader::fromByteArray(const QString &title, const QByteArray &ba) +QDomDocument tst_QXmlSimpleReader::fromByteArray(const QString &title, const QByteArray &ba, bool *ok) { QDomDocument doc(title); - const bool ret = doc.setContent(ba, true); - Q_ASSERT(ret); + *ok = doc.setContent(ba, true); return doc; } void tst_QXmlSimpleReader::roundtripWithNamespaces() const { - QEXPECT_FAIL("", "Known problem, see 154573. The fix happens to break uic.", Abort); - const char *const expected = "<element b:attr=\"value\" xmlns:a=\"http://www.example.com/A\" xmlns:b=\"http://www.example.com/B\" />\n"; + bool ok; { const char *const xml = "<element xmlns:b=\"http://www.example.com/B\" b:attr=\"value\" xmlns:a=\"http://www.example.com/A\"/>"; - const QDomDocument one(fromByteArray("document", xml)); - const QDomDocument two(fromByteArray("document2", one.toByteArray(2))); + const QDomDocument one(fromByteArray("document", xml, &ok)); + QVERIFY(ok); + const QDomDocument two(fromByteArray("document2", one.toByteArray(2), &ok)); + QVERIFY(ok); + + QEXPECT_FAIL("", "Known problem, see 154573. The fix happens to break uic.", Abort); QCOMPARE(expected, one.toByteArray().constData()); QCOMPARE(one.toByteArray(2).constData(), two.toByteArray(2).constData()); @@ -758,8 +760,10 @@ void tst_QXmlSimpleReader::roundtripWithNamespaces() const { const char *const xml = "<element b:attr=\"value\" xmlns:b=\"http://www.example.com/B\" xmlns:a=\"http://www.example.com/A\"/>"; - const QDomDocument one(fromByteArray("document", xml)); - const QDomDocument two(fromByteArray("document2", one.toByteArray(2))); + const QDomDocument one(fromByteArray("document", xml, &ok)); + QVERIFY(ok); + const QDomDocument two(fromByteArray("document2", one.toByteArray(2), &ok)); + QVERIFY(ok); QCOMPARE(expected, one.toByteArray().constData()); QCOMPARE(one.toByteArray(2).constData(), two.toByteArray(2).constData()); |