aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-04-08 16:57:30 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-04-09 07:00:00 +0000
commitbc00353cffbfe0f74b602a16452f2e7bcd588152 (patch)
tree3efec3f29b7b7338c92e66c15eced634d5e8f054 /tests/auto
parent4b6832828e04a9806aaf345da5f456817dd3970b (diff)
Detect and reject cyclic aliases
Previously those would result in infinite recursion. Fixes: QTBUG-74867 Change-Id: I6c0043b43e72fe7bc3a2a139ca600af2d5bca5ad Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/qqmllanguage/data/cyclicAlias.errors.txt1
-rw-r--r--tests/auto/qml/qqmllanguage/data/cyclicAlias.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/data/cyclicAlias.errors.txt b/tests/auto/qml/qqmllanguage/data/cyclicAlias.errors.txt
new file mode 100644
index 0000000000..46951ef69f
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/cyclicAlias.errors.txt
@@ -0,0 +1 @@
+4:5:Cyclic alias
diff --git a/tests/auto/qml/qqmllanguage/data/cyclicAlias.qml b/tests/auto/qml/qqmllanguage/data/cyclicAlias.qml
new file mode 100644
index 0000000000..23129e210d
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/cyclicAlias.qml
@@ -0,0 +1,5 @@
+import QtQml 2.2
+QtObject {
+ id: o
+ property alias t: o.t
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index dea7c6c7ee..f7198415a2 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -612,6 +612,7 @@ void tst_qqmllanguage::errors_data()
QTest::newRow("badCompositeRegistration.1") << "badCompositeRegistration.1.qml" << "badCompositeRegistration.1.errors.txt" << false;
QTest::newRow("badCompositeRegistration.2") << "badCompositeRegistration.2.qml" << "badCompositeRegistration.2.errors.txt" << false;
+ QTest::newRow("cyclicAlias") << "cyclicAlias.qml" << "cyclicAlias.errors.txt" << false;
}