diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-05-04 13:07:56 (GMT) |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-05-04 13:07:56 (GMT) |
commit | 15765bc59d2569803d5b1b200e26919e27d00bcd (patch) | |
tree | 0cdfc4f33ac299854bc4dae0227f512065932564 /tests/auto | |
parent | d4085c032d06bfe21ff3fef5657ceca201d18feb (diff) | |
download | Qt-15765bc59d2569803d5b1b200e26919e27d00bcd.zip Qt-15765bc59d2569803d5b1b200e26919e27d00bcd.tar.gz Qt-15765bc59d2569803d5b1b200e26919e27d00bcd.tar.bz2 |
Added (failing) testcase for QmlDomValueValueSource.
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qmldom/tst_qmldom.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmldom/tst_qmldom.cpp b/tests/auto/declarative/qmldom/tst_qmldom.cpp index 390e79a..91fe7a6 100644 --- a/tests/auto/declarative/qmldom/tst_qmldom.cpp +++ b/tests/auto/declarative/qmldom/tst_qmldom.cpp @@ -16,6 +16,8 @@ private slots: void loadProperties(); void loadChildObject(); + void testValueSource(); + private: QmlEngine engine; }; @@ -85,6 +87,23 @@ void tst_qmldom::loadChildObject() QVERIFY(childItem.objectType() == "Item"); } +void tst_qmldom::testValueSource() +{ + QByteArray qml = "Rect { height: Follow { spring: 1.4; damping: .15; source: Math.min(Math.max(-130, value*2.2 - 130), 133); }}"; + + QmlEngine freshEngine; + QmlDomDocument document; + QVERIFY(document.load(&freshEngine, qml)); + + QmlDomObject rootItem = document.rootObject(); + QVERIFY(rootItem.isValid()); + QmlDomProperty heightProperty = rootItem.properties().at(0); + QVERIFY(heightProperty.propertyName() == "height"); + QVERIFY(heightProperty.value().isValueSource()); + const QmlDomValueValueSource valueSource = heightProperty.value().toValueSource(); + QVERIFY(valueSource.object().isValid()); +} + QTEST_MAIN(tst_qmldom) #include "tst_qmldom.moc" |