aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-04-13 13:46:20 +0200
committerRobin Burchell <robin.burchell@crimson.no>2017-04-13 18:33:44 +0000
commit568005a5d3ecd78608d619cc9dc6063276baa316 (patch)
treef38696990a6a861173429e416b91e4a8b0f9ab09 /tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
parent9c1c471e54bb12e8740b76d1c048f2f916a6ab59 (diff)
QQmlConnections: Don't crash (or read past bounds) if a silly prop name is given
Change-Id: I156d27b21159f019a969a33e553e63fac9a3d193 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp')
-rw-r--r--tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
index b3ac1ce958..1ed94fcb93 100644
--- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
+++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
@@ -53,6 +53,7 @@ private slots:
void singletonTypeTarget();
void enableDisable_QTBUG_36350();
void clearImplicitTarget();
+ void onWithoutASignal();
private:
QQmlEngine engine;
@@ -379,6 +380,15 @@ void tst_qqmlconnections::clearImplicitTarget()
delete item;
}
+void tst_qqmlconnections::onWithoutASignal()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("connection-no-signal-name.qml"));
+ QVERIFY(c.isError()); // Cannot assign to non-existent property "on" expected
+ QScopedPointer<QQuickItem> item(qobject_cast<QQuickItem*>(c.create()));
+ QVERIFY(item == nullptr); // should parse error, and not give us an item (or crash).
+}
+
QTEST_MAIN(tst_qqmlconnections)
#include "tst_qqmlconnections.moc"