diff options
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp')
-rw-r--r-- | tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp index 3a70890362..efd5bb571b 100644 --- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp +++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp @@ -116,6 +116,7 @@ private slots: void onDestructionCount(); void recursion(); void recursionContinuation(); + void partialComponentCreation(); void callingContextForInitialProperties(); void setNonExistentInitialProperty(); void relativeUrl_data(); @@ -527,6 +528,29 @@ void tst_qqmlcomponent::recursionContinuation() QVERIFY(object->property("success").toBool()); } +void tst_qqmlcomponent::partialComponentCreation() +{ + const int maxCount = 17; + QQmlEngine engine; + QScopedPointer<QQmlComponent> components[maxCount]; + QScopedPointer<QObject> objects[maxCount]; + QQmlTestMessageHandler messageHandler; + + QCOMPARE(engine.outputWarningsToStandardError(), true); + + for (int i = 0; i < maxCount; i++) { + components[i].reset(new QQmlComponent(&engine, testFileUrl("QtObjectComponent.qml"))); + objects[i].reset(components[i]->beginCreate(engine.rootContext())); + QVERIFY(objects[i].isNull() == false); + } + QVERIFY2(messageHandler.messages().isEmpty(), qPrintable(messageHandler.messageString())); + + for (int i = 0; i < maxCount; i++) { + components[i]->completeCreate(); + } + QVERIFY2(messageHandler.messages().isEmpty(), qPrintable(messageHandler.messageString())); +} + class CallingContextCheckingClass : public QObject { Q_OBJECT |