summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdom
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-04-20 06:27:07 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-04-21 01:12:08 (GMT)
commit6181805f9ea66b37ee164bd67bdac2ac9d53fb65 (patch)
treed0a200d61a311deae9faf72d9c0bdfef04e57315 /tests/auto/qdom
parente754832eff8e1a35fc2681ae69b6e3b1ad666ddb (diff)
downloadQt-6181805f9ea66b37ee164bd67bdac2ac9d53fb65.zip
Qt-6181805f9ea66b37ee164bd67bdac2ac9d53fb65.tar.gz
Qt-6181805f9ea66b37ee164bd67bdac2ac9d53fb65.tar.bz2
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
Diffstat (limited to 'tests/auto/qdom')
-rw-r--r--tests/auto/qdom/tst_qdom.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp
index 18aa84a..f3b3e00 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));
}