aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-10-18 10:08:39 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-10-21 12:47:50 +0200
commitc23f85e159245f4f01f095bbb50dd01df4df2b62 (patch)
tree2285ecc6492aad083c66e32a579778df68602fbd
parentc494e07f6d7293b685325575f8ea9bd5c1d3e91c (diff)
Add test-case for self-instantiation producing an error
Change-Id: I2bc024c238e35e74eac59627d63743e596ece224 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--tests/auto/qml/qqmllanguage/data/SelfInstantiation.errors.txt1
-rw-r--r--tests/auto/qml/qqmllanguage/data/SelfInstantiation.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp2
3 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/SelfInstantiation.errors.txt b/tests/auto/qml/qqmllanguage/data/SelfInstantiation.errors.txt
new file mode 100644
index 0000000000..dfd077941e
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/SelfInstantiation.errors.txt
@@ -0,0 +1 @@
+3:29:SelfInstantiation is instantiated recursively
diff --git a/tests/auto/qml/qqmllanguage/data/SelfInstantiation.qml b/tests/auto/qml/qqmllanguage/data/SelfInstantiation.qml
new file mode 100644
index 0000000000..b2e4e453a0
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/SelfInstantiation.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+QtObject {
+ property QtObject self: SelfInstantiation {
+ }
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index a19a82cf55..ca34e1a6b5 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -630,6 +630,8 @@ void tst_qqmllanguage::errors_data()
QTest::newRow("typeAnnotations.2") << "typeAnnotations.2.qml" << "typeAnnotations.2.errors.txt" << false;
QTest::newRow("propertyUnknownType") << "propertyUnknownType.qml" << "propertyUnknownType.errors.txt" << false;
+
+ QTest::newRow("selfInstantiation") << "SelfInstantiation.qml" << "SelfInstantiation.errors.txt" << false;
}
void tst_qqmllanguage::errors()