From dbdaaa78c6b7c7a9498de9703d15b654eab163de Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 2 Sep 2009 10:49:14 +1000 Subject: Fix propertyValueSource test --- tests/auto/declarative/qmlparser/tst_qmlparser.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp index 36471a4..e953717 100644 --- a/tests/auto/declarative/qmlparser/tst_qmlparser.cpp +++ b/tests/auto/declarative/qmlparser/tst_qmlparser.cpp @@ -429,23 +429,25 @@ void tst_qmlparser::autoComponentCreation() void tst_qmlparser::propertyValueSource() { - QVERIFY(false); - -/* Does not compile... - QmlComponent component(&engine, TEST_FILE("propertyValueSource.qml")); VERIFY_ERRORS(0); MyTypeObject *object = qobject_cast(component.create()); QVERIFY(object != 0); - QList valueSources = - object->findChildren(); + + QList valueSources; + QObjectList allChildren = object->findChildren(); + foreach (QObject *child, allChildren) { + QmlType *type = QmlMetaType::qmlType(child->metaObject()); + if (type && type->propertyValueSourceCast() != -1) + valueSources.append(child); + } + QCOMPARE(valueSources.count(), 1); MyPropertyValueSource *valueSource = qobject_cast(valueSources.at(0)); QVERIFY(valueSource != 0); QCOMPARE(valueSource->prop.object(), object); QCOMPARE(valueSource->prop.name(), QString(QLatin1String("intProperty"))); -*/ } void tst_qmlparser::attachedProperties() -- cgit v0.12