diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-04-20 16:27:07 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-05-18 10:46:41 +1000 |
commit | 2d471a2bef76237e6796e011d06a96b34c4ca96e (patch) | |
tree | 96f72327a9b9d786351176e15c162c11ead695d1 /tests/auto | |
parent | 20d16d3f8bec7557490a1c12d5e2a946cf5bf42e (diff) |
Remove Q_ASSERT from QDom autotest
The Q_ASSERT here should really be a QVERIFY. Expanded the trivial
helper function to make it more obvious what the test does.
Change-Id: Ia6017fe820a83b4d6101e5edcfcb68993eef233a
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
(cherry picked from commit 6181805f9ea66b37ee164bd67bdac2ac9d53fb65)
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qdom/tst_qdom.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 18aa84a844..f3b3e00263 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -137,7 +137,6 @@ private slots: private: static QDomDocument generateRequest(); - static QDomDocument doc(const QString &title, const QByteArray &ba); static int hasAttributesHelper( const QDomNode& node ); static bool compareDocuments( const QDomDocument &doc1, const QDomDocument &doc2 ); static bool compareNodes( const QDomNode &node1, const QDomNode &node2, bool deep ); @@ -1591,14 +1590,6 @@ void tst_QDom::reportDuplicateAttributes() const QVERIFY2(!isSuccess, "Duplicate attributes are well-formedness errors, and should be reported as such."); } -QDomDocument tst_QDom::doc(const QString &title, const QByteArray &ba) -{ - QDomDocument doc(title); - const bool ret = doc.setContent(ba, true); - Q_ASSERT(ret); - return doc; -} - void tst_QDom::namespacedAttributes() const { static const char *const xml = @@ -1611,8 +1602,13 @@ void tst_QDom::namespacedAttributes() const " <Title displayLabel='Title' >>>> SIMPLE BASIC OP - SEND - DUT AS SINK</Title>\n" "</xan:td>\n"; - QDomDocument one = doc("document", xml); - QDomDocument two = doc("document2", one.toByteArray(2)); + QDomDocument one("document"); + QString error; + bool docParsed = one.setContent(QByteArray(xml), true, &error); + QVERIFY2(docParsed, qPrintable(error)); + QDomDocument two("document2"); + docParsed = two.setContent(one.toByteArray(2), true, &error); + QVERIFY2(docParsed, qPrintable(error)); QVERIFY(isDeepEqual(one, two)); } |