diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-05-09 17:45:52 +1000 |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-05-18 11:04:38 +1000 |
commit | bdffdef0d04e1cd83cf101dbb86462f0de85ea8c (patch) | |
tree | 2fd287d1a353024244acbe0e6f3b733757c8701f /tests/auto/qxmlquery | |
parent | 291b578a7759d87f6be9766718ac206a48565285 (diff) | |
download | qtxmlpatterns-bdffdef0d04e1cd83cf101dbb86462f0de85ea8c.tar.gz |
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
(cherry picked from commit 1acca025082bad566e5fe7078aa41f73316cd40b)
Diffstat (limited to 'tests/auto/qxmlquery')
-rw-r--r-- | tests/auto/qxmlquery/NetworkOverrider.h | 13 | ||||
-rw-r--r-- | tests/auto/qxmlquery/tst_qxmlquery.cpp | 2 |
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); |