summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-19 03:01:28 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-19 03:01:28 (GMT)
commitbfe06c2531fa47d4d417ec22bdb184b06ad0f073 (patch)
treed6ac160858673797d7273ca0eb86dcf55e486bfe /tests
parentab08c7d19ae854a8ffdcc47c9ed4094b593297fa (diff)
parentd4e35bced214119c7d825eb9d3bd76c1114934ba (diff)
downloadQt-bfe06c2531fa47d4d417ec22bdb184b06ad0f073.zip
Qt-bfe06c2531fa47d4d417ec22bdb184b06ad0f073.tar.gz
Qt-bfe06c2531fa47d4d417ec22bdb184b06ad0f073.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/states/tst_states.cpp27
1 files changed, 27 insertions, 0 deletions
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"