summaryrefslogtreecommitdiffstats
path: root/tests/auto/qxmlquery
diff options
context:
space:
mode:
authorJyri Tahtela <jyri.tahtela@nokia.com>2011-05-18 07:41:09 (GMT)
committerJyri Tahtela <jyri.tahtela@nokia.com>2011-05-18 07:41:09 (GMT)
commit9cacde74f7de702689725882633073e60c0a2baa (patch)
tree330d22dadbd28b14a7d8896823d1c33597e9993e /tests/auto/qxmlquery
parent006c8e22075112eff6230d8168d716e44a9e29d5 (diff)
parent2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (diff)
downloadQt-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/qxmlquery')
-rw-r--r--tests/auto/qxmlquery/MessageValidator.cpp5
-rw-r--r--tests/auto/qxmlquery/NetworkOverrider.h13
-rw-r--r--tests/auto/qxmlquery/PushBaseliner.h7
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp4
4 files changed, 21 insertions, 8 deletions
diff --git a/tests/auto/qxmlquery/MessageValidator.cpp b/tests/auto/qxmlquery/MessageValidator.cpp
index b37fba1..0a588f6 100644
--- a/tests/auto/qxmlquery/MessageValidator.cpp
+++ b/tests/auto/qxmlquery/MessageValidator.cpp
@@ -51,9 +51,8 @@ MessageValidator::MessageValidator() : m_success(false)
MessageValidator::~MessageValidator()
{
- Q_ASSERT_X(m_hasChecked,
- Q_FUNC_INFO,
- "You must call success().");
+ if (!m_hasChecked)
+ qFatal("%s: You must call success().", Q_FUNC_INFO);
}
void MessageValidator::handleMessage(QtMsgType type,
diff --git a/tests/auto/qxmlquery/NetworkOverrider.h b/tests/auto/qxmlquery/NetworkOverrider.h
index 3322054..c64e422 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/PushBaseliner.h b/tests/auto/qxmlquery/PushBaseliner.h
index 8d9753c..652d919 100644
--- a/tests/auto/qxmlquery/PushBaseliner.h
+++ b/tests/auto/qxmlquery/PushBaseliner.h
@@ -65,9 +65,9 @@ public:
const QXmlNamePool &namePool) : m_out(out)
, m_namePool(namePool)
{
- Q_ASSERT(m_out.codec());
}
+ bool isValid() const;
virtual void startElement(const QXmlName&);
virtual void endElement();
virtual void attribute(const QXmlName&, const QStringRef&);
@@ -86,6 +86,11 @@ private:
const QXmlNamePool m_namePool;
};
+bool PushBaseliner::isValid() const
+{
+ return m_out.codec();
+}
+
void PushBaseliner::startElement(const QXmlName &name)
{
m_out << "startElement(" << name.toClarkName(m_namePool) << ')'<< endl;
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index 853679f..1d3a0bc 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -967,6 +967,7 @@ void tst_QXmlQuery::evaluateToReceiver()
QString produced;
QTextStream stream(&produced, QIODevice::WriteOnly);
PushBaseliner push(stream, query.namePool());
+ QVERIFY(push.isValid());
query.evaluateTo(&push);
const QString baselineName(inputFile(QLatin1String(SRCDIR "pushBaselines/") + inputQuery.left(inputQuery.length() - 2) + QString::fromLatin1("ref")));
@@ -1685,6 +1686,7 @@ void tst_QXmlQuery::constCorrectness() const
QString dummyString;
QTextStream dummyStream(&dummyString);
PushBaseliner dummy(dummyStream, query.namePool());
+ QVERIFY(dummy.isValid());
query.evaluateTo(&dummy);
}
}
@@ -3078,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);
@@ -3094,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);