Fix qqmlecmascript::enums and nonNotifyable
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 7 Jun 2013 21:21:27 +0000 (23:21 +0200)
committerLars Knoll <lars.knoll@digia.com>
Sat, 8 Jun 2013 20:40:56 +0000 (22:40 +0200)
In the v8 bindings in expressionIdentifier we used to print the url with line
number and only in the base class we printed the expression itself. With
qv8bindings.cpp gone, we can do that now in the base class, as expected by the
test.

Adjusted the test also by columns.

Change-Id: I8d532d21baf5bf2fbfcca56c2657a1d65025fe84
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/qqmlbinding.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

index 79b1b2e..eff17dd 100644 (file)
@@ -301,7 +301,7 @@ QString QQmlBinding::expressionIdentifier(QQmlJavaScriptExpression *e)
 {
     QQmlBinding *This = static_cast<QQmlBinding *>(e);
 
-    return QLatin1Char('"') + QString::fromUtf8(This->m_expression) + QLatin1Char('"');
+    return This->m_url + QLatin1Char(':') + QString::number(This->m_lineNumber) + QLatin1Char(':') + QString::number(This->m_columnNumber);
 }
 
 void QQmlBinding::expressionChanged(QQmlJavaScriptExpression *e)
index 3242380..d438fd1 100644 (file)
@@ -972,13 +972,13 @@ void tst_qqmlecmascript::enums()
     {
     QUrl file = testFileUrl("enums.2.qml");
     QString w1 = QLatin1String("QMetaProperty::read: Unable to handle unregistered datatype 'MyEnum' for property 'MyUnregisteredEnumTypeObject::enumProperty'");
-    QString w2 = QLatin1String("QQmlExpression: Expression ") + testFileUrl("enums.2.qml").toString() + QLatin1String(":9 depends on non-NOTIFYable properties:");
+    QString w2 = QLatin1String("QQmlExpression: Expression ") + testFileUrl("enums.2.qml").toString() + QLatin1String(":9:21 depends on non-NOTIFYable properties:");
     QString w3 = QLatin1String("    MyUnregisteredEnumTypeObject::enumProperty");
-    QString w4 = file.toString() + ":7: Unable to assign [undefined] to int";
-    QString w5 = file.toString() + ":8: Unable to assign [undefined] to int";
-    QString w6 = file.toString() + ":9: Unable to assign [undefined] to int";
-    QString w7 = file.toString() + ":13: Unable to assign [undefined] to [unknown property type]";
-    QString w8 = file.toString() + ":31: Unable to assign int to [unknown property type]";
+    QString w4 = file.toString() + ":7:21: Unable to assign [undefined] to int";
+    QString w5 = file.toString() + ":8:21: Unable to assign [undefined] to int";
+    QString w6 = file.toString() + ":9:21: Unable to assign [undefined] to int";
+    QString w7 = file.toString() + ":13:23: Unable to assign [undefined] to [unknown property type]";
+    QString w8 = file.toString() + ":31:23: Unable to assign int to [unknown property type]";
     QTest::ignoreMessage(QtWarningMsg, qPrintable(w1));
     QTest::ignoreMessage(QtWarningMsg, qPrintable(w2));
     QTest::ignoreMessage(QtWarningMsg, qPrintable(w3));
@@ -6444,7 +6444,7 @@ void tst_qqmlecmascript::nonNotifyable()
 
     QString expected1 = QLatin1String("QQmlExpression: Expression ") +
                         component.url().toString() +
-                        QLatin1String(":5 depends on non-NOTIFYable properties:");
+                        QLatin1String(":5:24 depends on non-NOTIFYable properties:");
     QString expected2 = QLatin1String("    ") +
                         QLatin1String(object->metaObject()->className()) +
                         QLatin1String("::value");