From 74c8e4c15fce7dce9d279b6a8086aaf679500fab Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 4 May 2009 15:42:32 +0200 Subject: Extended the test for QmlDomValueValueSource. --- tests/auto/declarative/qmldom/tst_qmldom.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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) -- cgit v0.12