summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmldom
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qmldom')
-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)