aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlproperty
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-04-04 13:54:29 +1000
committerQt by Nokia <qt-info@nokia.com>2012-04-04 08:43:50 +0200
commit38d535bd9a4aca8a897e2ae15aed13daa822de2d (patch)
treeab2b1335935be1b34cc8858aee38fbde1ae463a8 /tests/auto/qml/qqmlproperty
parent639208cc7f3ab3d8356363559e8fcf168e32cf0b (diff)
Do not crash on invalid binding diagnostic
If there is no meta object for the property type of the recipient of an invalid binding, fall back to QMetaType::typename(). Task-number: QTBUG-25161 Change-Id: I0bb768cbc166c04f62d20d8bb19e6ae883d7dc2f Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlproperty')
-rw-r--r--tests/auto/qml/qqmlproperty/data/invalidBinding.qml2
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp4
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/data/invalidBinding.qml b/tests/auto/qml/qqmlproperty/data/invalidBinding.qml
index 35dacf1619..e2bb1d172d 100644
--- a/tests/auto/qml/qqmlproperty/data/invalidBinding.qml
+++ b/tests/auto/qml/qqmlproperty/data/invalidBinding.qml
@@ -10,5 +10,7 @@ Item {
Text {
id: myText
+
+ anchors.verticalCenter: parent // invalid binding
}
}
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index 23f7c3437d..5d7485c68d 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -1736,6 +1736,10 @@ void tst_qqmlproperty::warnOnInvalidBinding()
expectedWarning = testUrl.toString() + QString::fromLatin1(":7:36: Unable to assign QQuickText to QQuickRectangle");
QTest::ignoreMessage(QtWarningMsg, expectedWarning.toLatin1().constData());
+ // V8 error message for invalid binding to anchor
+ expectedWarning = testUrl.toString() + QString::fromLatin1(":14: Unable to assign QQuickItem_QML_7 to QQuickAnchorLine");
+ QTest::ignoreMessage(QtWarningMsg, expectedWarning.toLatin1().constData());
+
QQmlComponent component(&engine, testUrl);
QObject *obj = component.create();
QVERIFY(obj);