diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-07-20 09:29:00 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-07-20 09:53:58 (GMT) |
commit | 0f494029a61a2f9f31917be6e6e954b6bb606085 (patch) | |
tree | 964ca90d64c9b68624aa72dbfe36a66bc638e624 /tests/auto/qxmlquery | |
parent | 2d6caf67f8e2a49c5c5516e6837ed6b2862130c2 (diff) | |
download | Qt-0f494029a61a2f9f31917be6e6e954b6bb606085.zip Qt-0f494029a61a2f9f31917be6e6e954b6bb606085.tar.gz Qt-0f494029a61a2f9f31917be6e6e954b6bb606085.tar.bz2 |
Fix assert in message handling.
Trivial fix. Reported by Michael Brasser.
Task-number: 258337
Reviewed-By: Peter Hartmann
Diffstat (limited to 'tests/auto/qxmlquery')
-rw-r--r-- | tests/auto/qxmlquery/tst_qxmlquery.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 28af641..b273311 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -219,6 +219,7 @@ private Q_SLOTS: void bindVariableQXmlNameQXmlQuerySignature() const; void bindVariableQXmlNameQXmlQuery() const; void bindVariableQXmlQueryInvalidate() const; + void unknownSourceLocation() const; // TODO call all URI resolving functions where 1) the URI resolver return a null QUrl(); 2) resolves into valid, existing URI, 3) invalid, non-existing URI. // TODO bind stringlists, variant lists, both ways. @@ -3222,6 +3223,23 @@ void tst_QXmlQuery::bindVariableQXmlQueryInvalidate() const QVERIFY(!query.isValid()); } +void tst_QXmlQuery::unknownSourceLocation() const +{ + QBuffer b; + b.setData("<a><b/><b/></a>"); + b.open(QIODevice::ReadOnly); + + MessageSilencer silencer; + QXmlQuery query; + query.bindVariable(QLatin1String("inputDocument"), &b); + query.setMessageHandler(&silencer); + + query.setQuery(QLatin1String("doc($inputDocument)/a/(let $v := b/string() return if ($v) then $v else ())")); + + QString output; + query.evaluateTo(&output); +} + QTEST_MAIN(tst_QXmlQuery) #include "tst_qxmlquery.moc" |