diff options
Diffstat (limited to 'tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp')
-rw-r--r-- | tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp index b9cede6d13..690db30838 100644 --- a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp +++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp @@ -44,6 +44,7 @@ public: private slots: void test_qmlClearTypeRegistrations(); void test_valueTypeProviderModule(); // QTBUG-43004 + void test_customModuleCleanup(); }; // A wrapper around QQmlComponent to ensure the temporary reference counts @@ -168,6 +169,23 @@ void tst_qqmlenginecleanup::test_valueTypeProviderModule() QVERIFY(noDangling); } +void tst_qqmlenginecleanup::test_customModuleCleanup() +{ + for (int i = 0; i < 5; ++i) { + qmlClearTypeRegistrations(); + + QQmlEngine engine; + engine.addImportPath(QT_TESTCASE_BUILDDIR); + + QQmlComponent component(&engine); + component.setData("import CustomModule 1.0\nModuleType {}", QUrl()); + QCOMPARE(component.status(), QQmlComponent::Ready); + + QScopedPointer<QObject> object(component.create()); + QVERIFY(!object.isNull()); + } +} + QTEST_MAIN(tst_qqmlenginecleanup) #include "tst_qqmlenginecleanup.moc" |