diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-19 02:59:38 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-19 02:59:38 (GMT) |
commit | ce914b37ee06e689af1bb5a2a1a932e9125f7276 (patch) | |
tree | 855010af303300f1a5ed01b5cae797602484e273 /tests | |
parent | c72211c1f518adc53e12aaf70e47e966a50698d5 (diff) | |
parent | bfe06c2531fa47d4d417ec22bdb184b06ad0f073 (diff) | |
download | Qt-ce914b37ee06e689af1bb5a2a1a932e9125f7276.zip Qt-ce914b37ee06e689af1bb5a2a1a932e9125f7276.tar.gz Qt-ce914b37ee06e689af1bb5a2a1a932e9125f7276.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp | 38 | ||||
-rw-r--r-- | tests/auto/declarative/states/tst_states.cpp | 27 |
2 files changed, 61 insertions, 4 deletions
diff --git a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp index 71eefdd..92b2c1a 100644 --- a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp +++ b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp @@ -1,11 +1,41 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ ** ****************************************************************************/ diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp index 92d278a..a4da1f1 100644 --- a/tests/auto/declarative/states/tst_states.cpp +++ b/tests/auto/declarative/states/tst_states.cpp @@ -68,6 +68,7 @@ private slots: void restoreEntryValues(); void explicitChanges(); void propertyErrors(); + void incorrectRestoreBug(); }; void tst_states::basicChanges() @@ -711,6 +712,32 @@ void tst_states::propertyErrors() rect->setState("blue"); } +void tst_states::incorrectRestoreBug() +{ + QmlEngine engine; + + QmlComponent rectComponent(&engine, SRCDIR "/data/basicChanges.qml"); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); + + QCOMPARE(rect->color(),QColor("red")); + + rect->setState("blue"); + QCOMPARE(rect->color(),QColor("blue")); + + rect->setState(""); + QCOMPARE(rect->color(),QColor("red")); + + // make sure if we change the base state value, we then restore to it correctly + rect->setColor(QColor("green")); + + rect->setState("blue"); + QCOMPARE(rect->color(),QColor("blue")); + + rect->setState(""); + QCOMPARE(rect->color(),QColor("green")); +} + QTEST_MAIN(tst_states) #include "tst_states.moc" |