diff options
Diffstat (limited to 'tests/auto/qml/qqmltypeloader')
3 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmltypeloader/data/CircularDependency.qml b/tests/auto/qml/qqmltypeloader/data/CircularDependency.qml new file mode 100644 index 0000000000..0b7c030063 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/CircularDependency.qml @@ -0,0 +1,3 @@ +import QtQml 2.0 + +CircularDependencyBase {} diff --git a/tests/auto/qml/qqmltypeloader/data/CircularDependencyBase.qml b/tests/auto/qml/qqmltypeloader/data/CircularDependencyBase.qml new file mode 100644 index 0000000000..d068d1cabc --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/CircularDependencyBase.qml @@ -0,0 +1,3 @@ +import QtQml 2.0 + +CircularDependency {} diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp index 266a4e97d6..1303a4b19c 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp @@ -63,6 +63,7 @@ private slots: void implicitImport(); void compositeSingletonCycle(); void declarativeCppType(); + void circularDependency(); }; void tst_QQMLTypeLoader::testLoadComplete() @@ -592,6 +593,14 @@ void tst_QQMLTypeLoader::declarativeCppType() QVERIFY(!obj.isNull()); } +void tst_QQMLTypeLoader::circularDependency() +{ + QQmlEngine engine; + QTest::ignoreMessage(QtWarningMsg, QRegularExpression("Cyclic dependency detected between (.*) and (.*)")); + QQmlComponent component(&engine, testFileUrl("CircularDependency.qml")); + QCOMPARE(component.status(), QQmlComponent::Null); +} + QTEST_MAIN(tst_QQMLTypeLoader) #include "tst_qqmltypeloader.moc" |