summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmldom/tst_qmldom.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@nokia.com>2009-05-04 13:42:32 (GMT)
committerErik Verbruggen <erik.verbruggen@nokia.com>2009-05-04 13:42:32 (GMT)
commit74c8e4c15fce7dce9d279b6a8086aaf679500fab (patch)
treebc9a0da7dad9b9903a6dad8e3c83f30521031007 /tests/auto/declarative/qmldom/tst_qmldom.cpp
parent51a0ebdea3942e23cd7396b57d7c452442d1371d (diff)
downloadQt-74c8e4c15fce7dce9d279b6a8086aaf679500fab.zip
Qt-74c8e4c15fce7dce9d279b6a8086aaf679500fab.tar.gz
Qt-74c8e4c15fce7dce9d279b6a8086aaf679500fab.tar.bz2
Extended the test for QmlDomValueValueSource.
Diffstat (limited to 'tests/auto/declarative/qmldom/tst_qmldom.cpp')
-rw-r--r--tests/auto/declarative/qmldom/tst_qmldom.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/auto/declarative/qmldom/tst_qmldom.cpp b/tests/auto/declarative/qmldom/tst_qmldom.cpp
index 91fe7a6..36d37f6 100644
--- a/tests/auto/declarative/qmldom/tst_qmldom.cpp
+++ b/tests/auto/declarative/qmldom/tst_qmldom.cpp
@@ -100,8 +100,22 @@ void tst_qmldom::testValueSource()
QmlDomProperty heightProperty = rootItem.properties().at(0);
QVERIFY(heightProperty.propertyName() == "height");
QVERIFY(heightProperty.value().isValueSource());
+
const QmlDomValueValueSource valueSource = heightProperty.value().toValueSource();
- QVERIFY(valueSource.object().isValid());
+ QmlDomObject valueSourceObject = valueSource.object();
+ QVERIFY(valueSourceObject.isValid());
+
+ QVERIFY(valueSourceObject.objectType() == "Follow");
+
+ const QmlDomValue springValue = valueSourceObject.property("spring").value();
+ QVERIFY(!springValue.isInvalid());
+ QVERIFY(springValue.isLiteral());
+ QVERIFY(springValue.toLiteral().literal() == "1.4");
+
+ const QmlDomValue sourceValue = valueSourceObject.property("source").value();
+ QVERIFY(!sourceValue.isInvalid());
+ QVERIFY(sourceValue.isBinding());
+ QVERIFY(sourceValue.toBinding().binding() == "Math.min(Math.max(-130, value*2.2 - 130), 133)");
}
QTEST_MAIN(tst_qmldom)