diff options
author | Tobias Koenig <tokoe@kde.org> | 2009-07-05 08:47:45 (GMT) |
---|---|---|
committer | Tobias Koenig <tokoe@kde.org> | 2009-07-05 08:47:45 (GMT) |
commit | 5db5a9d5d878157a643a441d426ff739084ca031 (patch) | |
tree | d10017bbc11e62e44a7ced7e35de8516964e794a /tests/auto/qxmlquery | |
parent | 65c2d095cddfda32052925654dd1defd314ad4b3 (diff) | |
parent | 84bbac2a4d7b663e57b74094cbebf8fca16e0ed8 (diff) | |
download | Qt-5db5a9d5d878157a643a441d426ff739084ca031.zip Qt-5db5a9d5d878157a643a441d426ff739084ca031.tar.gz Qt-5db5a9d5d878157a643a441d426ff739084ca031.tar.bz2 |
Merge branch 'master' of git://gitorious.org/qt/qt
Diffstat (limited to 'tests/auto/qxmlquery')
-rw-r--r-- | tests/auto/qxmlquery/MessageSilencer.h | 4 | ||||
-rw-r--r-- | tests/auto/qxmlquery/MessageValidator.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qxmlquery/MessageValidator.h | 4 | ||||
-rw-r--r-- | tests/auto/qxmlquery/NetworkOverrider.h | 4 | ||||
-rw-r--r-- | tests/auto/qxmlquery/PushBaseliner.h | 4 | ||||
-rw-r--r-- | tests/auto/qxmlquery/TestFundament.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qxmlquery/TestFundament.h | 4 | ||||
-rw-r--r-- | tests/auto/qxmlquery/tst_qxmlquery.cpp | 56 |
8 files changed, 68 insertions, 16 deletions
diff --git a/tests/auto/qxmlquery/MessageSilencer.h b/tests/auto/qxmlquery/MessageSilencer.h index 07964df..115f04c 100644 --- a/tests/auto/qxmlquery/MessageSilencer.h +++ b/tests/auto/qxmlquery/MessageSilencer.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/qxmlquery/MessageValidator.cpp b/tests/auto/qxmlquery/MessageValidator.cpp index b4908f0..d7dcb62 100644 --- a/tests/auto/qxmlquery/MessageValidator.cpp +++ b/tests/auto/qxmlquery/MessageValidator.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/qxmlquery/MessageValidator.h b/tests/auto/qxmlquery/MessageValidator.h index 6b7bb2f..1691aef 100644 --- a/tests/auto/qxmlquery/MessageValidator.h +++ b/tests/auto/qxmlquery/MessageValidator.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/qxmlquery/NetworkOverrider.h b/tests/auto/qxmlquery/NetworkOverrider.h index 85f14c3..5d7e04e 100644 --- a/tests/auto/qxmlquery/NetworkOverrider.h +++ b/tests/auto/qxmlquery/NetworkOverrider.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/qxmlquery/PushBaseliner.h b/tests/auto/qxmlquery/PushBaseliner.h index 0b79f19..ab0710f 100644 --- a/tests/auto/qxmlquery/PushBaseliner.h +++ b/tests/auto/qxmlquery/PushBaseliner.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/qxmlquery/TestFundament.cpp b/tests/auto/qxmlquery/TestFundament.cpp index 90e94f9..15c8e1c 100644 --- a/tests/auto/qxmlquery/TestFundament.cpp +++ b/tests/auto/qxmlquery/TestFundament.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/qxmlquery/TestFundament.h b/tests/auto/qxmlquery/TestFundament.h index ddac64f..f30b5a4 100644 --- a/tests/auto/qxmlquery/TestFundament.h +++ b/tests/auto/qxmlquery/TestFundament.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 6d8a803..fe9efae 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -34,7 +34,7 @@ ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** contact the sales department at http://www.qtsoftware.com/contact. ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -155,6 +155,9 @@ private Q_SLOTS: void setFocusQIODeviceAvoidVariableClash() const; void setFocusQIODeviceFailure() const; void setFocusQIODeviceTriggerWarnings() const; + void setFocusQString() const; + void setFocusQStringFailure() const; + void setFocusQStringSignature() const; void recompilationWithEvaluateToResultFailing() const; void secondEvaluationWithEvaluateToResultFailing() const; void recompilationWithEvaluateToReceiver() const; @@ -1898,6 +1901,55 @@ void tst_QXmlQuery::setFocusQIODeviceFailure() const } } +void tst_QXmlQuery::setFocusQString() const +{ + QXmlQuery query; + + /* Basic use of focus. */ + { + QVERIFY(query.setFocus(QLatin1String("<e>textNode</e>"))); + query.setQuery(QLatin1String("string()")); + QVERIFY(query.isValid()); + QString out; + query.evaluateTo(&out); + QCOMPARE(out, QString::fromLatin1("textNode\n")); + } + + /* Set to a new focus, make sure it changes and works. */ + { + QVERIFY(query.setFocus(QLatin1String("<e>newFocus</e>"))); + QString out; + query.evaluateTo(&out); + QCOMPARE(out, QString::fromLatin1("newFocus\n")); + } +} + +void tst_QXmlQuery::setFocusQStringFailure() const +{ + QXmlQuery query; + MessageSilencer silencer; + + query.setMessageHandler(&silencer); + QVERIFY(!query.setFocus(QLatin1String("<notWellformed"))); + + /* Let's try the slight special case of a null string. */ + QVERIFY(!query.setFocus(QString())); +} + +void tst_QXmlQuery::setFocusQStringSignature() const +{ + QXmlQuery query; + MessageSilencer silencer; + query.setMessageHandler(&silencer); + + const QString argument; + /* We should take a const ref. */ + query.setFocus(argument); + + /* We should return a bool. */ + static_cast<bool>(query.setFocus(QString())); +} + void tst_QXmlQuery::setFocusQIODeviceTriggerWarnings() const { /* A null pointer. */ |