diff options
author | Aapo Haapanen <aapo.haapanen@nokia.com> | 2011-09-26 11:47:50 (GMT) |
---|---|---|
committer | Aapo Haapanen <aapo.haapanen@nokia.com> | 2011-09-26 11:47:50 (GMT) |
commit | 7c626d2a9152a20f965d877c2de92e04bdfe3571 (patch) | |
tree | d664285f087fcd586da82cba79e06d4533481555 /tests | |
parent | 8d9e63130767858287331d7e19d732919d620607 (diff) | |
parent | 26341f6060434b6cbc08d98df34c2d2aee56a70c (diff) | |
download | Qt-7c626d2a9152a20f965d877c2de92e04bdfe3571.zip Qt-7c626d2a9152a20f965d877c2de92e04bdfe3571.tar.gz Qt-7c626d2a9152a20f965d877c2de92e04bdfe3571.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-flex
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro | 2 | ||||
-rw-r--r-- | tests/auto/qxmlquery/tst_qxmlquery.cpp | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro index b8f509d..90a99c0 100644 --- a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro +++ b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro @@ -6,7 +6,7 @@ HEADERS += TestNodeModel.h LoadingModel.h include (../xmlpatterns.pri) -wince*: { +wince*|symbian: { addFiles.files = tree.xml addFiles.path = . diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index e443720..51bb88e 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -167,6 +167,7 @@ private Q_SLOTS: void setFocusQString() const; void setFocusQStringFailure() const; void setFocusQStringSignature() const; + void setFocusQStringFailureAfterSucces() const; void recompilationWithEvaluateToResultFailing() const; void secondEvaluationWithEvaluateToResultFailing() const; void recompilationWithEvaluateToReceiver() const; @@ -1976,6 +1977,25 @@ void tst_QXmlQuery::setFocusQStringSignature() const static_cast<bool>(query.setFocus(QString())); } +void tst_QXmlQuery::setFocusQStringFailureAfterSucces() const +{ + /* Test for QTBUG-18050. First call setFocus with a valid string, + * and then with an invalid string. evaluateTo should not crash. */ + QXmlQuery query; + MessageSilencer silencer; + query.setMessageHandler(&silencer); + + QVERIFY(query.setFocus(QLatin1String("<test>valid-input</test>"))); + QVERIFY(!query.setFocus(QLatin1String("invalid-input"))); + + query.setQuery("/query"); + + QString output; + /* Last setFocus was with an invalid string, so evaluateTo should return + * false */ + QVERIFY(!query.evaluateTo(&output)); +} + void tst_QXmlQuery::setFocusQIODeviceTriggerWarnings() const { /* A null pointer. */ |