summaryrefslogtreecommitdiffstats
path: root/tests/auto/qxmlquery
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-09 07:45:52 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-10 02:49:47 (GMT)
commit1acca025082bad566e5fe7078aa41f73316cd40b (patch)
tree8013d8b2b83e93d9502d8ac0d5485932bb461404 /tests/auto/qxmlquery
parentb841d30f25a87f8aafc4624fe09a3503ddc6ccda (diff)
downloadQt-1acca025082bad566e5fe7078aa41f73316cd40b.zip
Qt-1acca025082bad566e5fe7078aa41f73316cd40b.tar.gz
Qt-1acca025082bad566e5fe7078aa41f73316cd40b.tar.bz2
Remove Q_ASSERT's from qxmlquery autotest
Make url validity check part of the regular test logic rather than aborting in debug builds and ignoring the error in release builds. Change-Id: Ic00610c04ee596f519b9d461748b401719cf41c0 Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto/qxmlquery')
-rw-r--r--tests/auto/qxmlquery/NetworkOverrider.h13
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp2
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/auto/qxmlquery/NetworkOverrider.h b/tests/auto/qxmlquery/NetworkOverrider.h
index 10a85c1..2f227ea 100644
--- a/tests/auto/qxmlquery/NetworkOverrider.h
+++ b/tests/auto/qxmlquery/NetworkOverrider.h
@@ -70,6 +70,7 @@ public:
virtual QNetworkReply *createRequest(Operation op,
const QNetworkRequest &req,
QIODevice *outgoingData);
+ bool isValid() const;
private:
const QUrl m_rewriteFrom;
@@ -77,11 +78,10 @@ private:
};
NetworkOverrider::NetworkOverrider(const QUrl &rewriteFrom,
- const QUrl &rewriteTo) : m_rewriteFrom(rewriteFrom)
- , m_rewriteTo(rewriteTo)
+ const QUrl &rewriteTo)
+ : m_rewriteFrom(rewriteFrom)
+ , m_rewriteTo(rewriteTo)
{
- Q_ASSERT(m_rewriteFrom.isValid());
- Q_ASSERT(m_rewriteTo.isValid());
}
QNetworkReply *NetworkOverrider::createRequest(Operation op,
@@ -95,4 +95,9 @@ QNetworkReply *NetworkOverrider::createRequest(Operation op,
return QNetworkAccessManager::createRequest(op, newReq, outgoingData);
}
+
+bool NetworkOverrider::isValid() const
+{
+ return m_rewriteFrom.isValid() && m_rewriteTo.isValid();
+}
#endif
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index e22f528..c002f83 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -3080,6 +3080,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
{
NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/queries/simpleDocument.xml"))));
+ QVERIFY(networkOverrider.isValid());
QXmlQuery query;
query.setNetworkAccessManager(&networkOverrider);
@@ -3096,6 +3097,7 @@ void tst_QXmlQuery::setNetworkAccessManager() const
{
NetworkOverrider networkOverrider(QUrl(QLatin1String("tag:example.com:DOESNOTEXIST")),
QUrl(inputFileAsURI(QLatin1String(XMLPATTERNSDIR "/queries/concat.xq"))));
+ QVERIFY(networkOverrider.isValid());
QXmlQuery query;
query.setNetworkAccessManager(&networkOverrider);