summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-09 18:21:18 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2011-05-18 11:04:38 +1000
commit291b578a7759d87f6be9766718ac206a48565285 (patch)
treec2f5823e31f510fa0b406b3a085b08906de2f218 /tests
parent54784b0453c1c6cfad62883a5db6d1afdf95bf90 (diff)
downloadqtxmlpatterns-291b578a7759d87f6be9766718ac206a48565285.tar.gz
Remove Q_ASSERT from qxmlquery autotest
Make stream validity check part of the regular test logic rather than aborting in debug builds and ignoring the error in release builds. Change-Id: I07dcba079eecd88bf16672c6019a8d6f5a829fee Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit b841d30f25a87f8aafc4624fe09a3503ddc6ccda)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qxmlquery/PushBaseliner.h7
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/qxmlquery/PushBaseliner.h b/tests/auto/qxmlquery/PushBaseliner.h
index 0648c90..8478a6a 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 e3c97d2..e22f528 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);
}
}