summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-08-02 14:43:56 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-03 03:58:30 +0200
commit680c98b04db6d5a49575782ba5bb58e06fa78bc2 (patch)
treebc22309ed20b41f9c2d2ff33f5a59b05385b8b39 /tests/auto/declarative
parent1830b5eab5aa692de33fe6f8fe9563b6632994fd (diff)
Do not assume ordering of resources declared for the default property
The order in which resources declared in QML are placed into the default property is not defined, and should not be relied upon. Task-number: QTBUG-26702 Change-Id: I5023b8dad89513cde69852e0c3a910477f60888e Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
index c77d6bb8..58434442 100644
--- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
+++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
@@ -1167,7 +1167,8 @@ void tst_QDeclarativeDebug::queryObjectTree()
// check state
- QDeclarativeDebugObjectReference state = obj.children()[0];
+ QDeclarativeDebugObjectReference state = obj.findChildByClassName(QString("State"));
+ QVERIFY(state.debugId() != -1);
QCOMPARE(state.className(), QString("State"));
QVERIFY(state.children().count() > 0);
@@ -1180,10 +1181,13 @@ void tst_QDeclarativeDebug::queryObjectTree()
QDeclarativeDebugObjectReference targetReference = qvariant_cast<QDeclarativeDebugObjectReference>(propertyChangeTarget.value());
QVERIFY(targetReference.debugId() != -1);
+ QDeclarativeDebugObjectReference nextState = obj.findChildByClassName(QString("State"), state);
+ QVERIFY(nextState.debugId() == -1);
// check transition
- QDeclarativeDebugObjectReference transition = obj.children()[1];
+ QDeclarativeDebugObjectReference transition = obj.findChildByClassName(QString("Transition"));
+ QVERIFY(transition.debugId() != -1);
QCOMPARE(transition.className(), QString("Transition"));
QCOMPARE(findProperty(transition.properties(),"from").value().toString(), QString("*"));
QCOMPARE(findProperty(transition.properties(),"to").value(), findProperty(state.properties(),"name").value());
@@ -1200,6 +1204,9 @@ void tst_QDeclarativeDebug::queryObjectTree()
QCOMPARE(findProperty(animation.properties(),"property").value().toString(), QString("width"));
QCOMPARE(findProperty(animation.properties(),"duration").value().toInt(), 100);
+
+ QDeclarativeDebugObjectReference nextTransition = obj.findChildByClassName(QString("Transition"), transition);
+ QVERIFY(nextTransition.debugId() == -1);
}
int main(int argc, char *argv[])