From 64dfb6f0e18378af16ee23c00c58d1964584ddb6 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 12 Jul 2016 17:32:57 +0200 Subject: [PATCH] QmlDesigner.Tests: Fix loadGradient() The order of nodes from directSubModelNodes() was not defined, since we collect the nodes from different properties ("default/data" and "gradient"). If we use the interface of NodeListProperty and explicitly use the default property, then the order is defined. Change-Id: I7982fa7749d1795ad39a7b76792ad794e49fa9ea Reviewed-by: Tim Jenssen --- tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index 7b5c93e5000..4953895df6e 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -7800,7 +7800,9 @@ void tst_TestCore::loadGradient() { QCOMPARE(rootModelNode.directSubModelNodes().count(), 2); - ModelNode gradientNode = rootModelNode.directSubModelNodes().last(); + QVERIFY(rootModelNode.defaultNodeListProperty().isValid()); + QCOMPARE(rootModelNode.defaultNodeListProperty().toModelNodeList().count(), 1); + ModelNode gradientNode = rootModelNode.defaultNodeListProperty().toModelNodeList().first(); QVERIFY(gradientNode.isValid()); QVERIFY(!gradientNode.metaInfo().isSubclassOf("QtQuick.Item", -1, -1)); QCOMPARE(gradientNode.type(), QmlDesigner::TypeName("QtQuick.Gradient"));