diff options
author | David Faure <david.faure@kdab.com> | 2014-07-25 18:29:19 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2014-07-26 00:46:13 +0200 |
commit | 8c80dd6a9893c6e323ae69b651efd7b629b2714c (patch) | |
tree | 843aa76e5125aa082419140d19e121bbb019ebf3 | |
parent | 302687f21c99643a2dd1930a19fde66ba725661e (diff) |
QDeclarativeError::toString: improve handling of empty urls.
"file::2:23: ..." is strange to read. Show "<Unknown File>:2:23: ..." instead,
by treating empty urls (including "file:") as unknown, and by still showing
line and column numbers in such a case.
This change makes it possible for QUrl::fromLocalFile("") to return an
empty url rather than "file:", which this module was relying upon in the tests.
Change-Id: Id6d8aaa73673283cb65cbd1316dca77f859a3f8f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
19 files changed, 58 insertions, 56 deletions
diff --git a/src/declarative/qml/qdeclarativeerror.cpp b/src/declarative/qml/qdeclarativeerror.cpp index 64d43d70..2232b382 100644 --- a/src/declarative/qml/qdeclarativeerror.cpp +++ b/src/declarative/qml/qdeclarativeerror.cpp @@ -216,14 +216,16 @@ void QDeclarativeError::setColumn(int column) QString QDeclarativeError::toString() const { QString rv; - if (url().isEmpty()) { + QUrl u(url()); + if (u.isEmpty() || (u.isLocalFile() && u.path().isEmpty())) rv = QLatin1String("<Unknown File>"); - } else if (line() != -1) { - rv = url().toString() + QLatin1Char(':') + QString::number(line()); + else + rv = u.toString(); + + if (line() > 0) { + rv += QLatin1Char(':') + QString::number(line()); if (column() != -1) rv += QLatin1Char(':') + QString::number(column()); - } else { - rv = url().toString(); } rv += QLatin1String(": ") + description(); diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index 74905bc4..b762bf70 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -134,7 +134,7 @@ QDeclarativeInfo::~QDeclarativeInfo() d->buffer.prepend(QLatin1String("QML ") + typeName + QLatin1String(": ")); QDeclarativeData *ddata = QDeclarativeData::get(object, false); - if (ddata && ddata->outerContext && !ddata->outerContext->url.isEmpty()) { + if (ddata && ddata->outerContext) { error.setUrl(ddata->outerContext->url); error.setLine(ddata->lineNumber); error.setColumn(ddata->columnNumber); diff --git a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp index 7869ffc4..7d2f123d 100644 --- a/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp +++ b/tests/auto/declarative/qdeclarativeanchors/tst_qdeclarativeanchors.cpp @@ -414,55 +414,55 @@ void tst_qdeclarativeanchors::illegalSets_data() QTest::newRow("H - too many anchors") << "Rectangle { id: rect; Rectangle { anchors.left: rect.left; anchors.right: rect.right; anchors.horizontalCenter: rect.horizontalCenter } }" - << "file::2:23: QML Rectangle: Cannot specify left, right, and hcenter anchors."; + << "<Unknown File>:2:23: QML Rectangle: Cannot specify left, right, and hcenter anchors."; foreach (const QString &side, QStringList() << "left" << "right") { QTest::newRow("H - anchor to V") << QString("Rectangle { Rectangle { anchors.%1: parent.top } }").arg(side) - << "file::2:13: QML Rectangle: Cannot anchor a horizontal edge to a vertical edge."; + << "<Unknown File>:2:13: QML Rectangle: Cannot anchor a horizontal edge to a vertical edge."; QTest::newRow("H - anchor to non parent/sibling") << QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side) - << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; + << "<Unknown File>:2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; QTest::newRow("H - anchor to self") << QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side) - << "file::2:1: QML Rectangle: Cannot anchor item to self."; + << "<Unknown File>:2:1: QML Rectangle: Cannot anchor item to self."; } QTest::newRow("V - too many anchors") << "Rectangle { id: rect; Rectangle { anchors.top: rect.top; anchors.bottom: rect.bottom; anchors.verticalCenter: rect.verticalCenter } }" - << "file::2:23: QML Rectangle: Cannot specify top, bottom, and vcenter anchors."; + << "<Unknown File>:2:23: QML Rectangle: Cannot specify top, bottom, and vcenter anchors."; QTest::newRow("V - too many anchors with baseline") << "Rectangle { Text { id: text1; text: \"Hello\" } Text { anchors.baseline: text1.baseline; anchors.top: text1.top; } }" - << "file::2:47: QML Text: Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors."; + << "<Unknown File>:2:47: QML Text: Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors."; foreach (const QString &side, QStringList() << "top" << "bottom" << "baseline") { QTest::newRow("V - anchor to H") << QString("Rectangle { Rectangle { anchors.%1: parent.left } }").arg(side) - << "file::2:13: QML Rectangle: Cannot anchor a vertical edge to a horizontal edge."; + << "<Unknown File>:2:13: QML Rectangle: Cannot anchor a vertical edge to a horizontal edge."; QTest::newRow("V - anchor to non parent/sibling") << QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side) - << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; + << "<Unknown File>:2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; QTest::newRow("V - anchor to self") << QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side) - << "file::2:1: QML Rectangle: Cannot anchor item to self."; + << "<Unknown File>:2:1: QML Rectangle: Cannot anchor item to self."; } QTest::newRow("centerIn - anchor to non parent/sibling") << "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.centerIn: rect} }" - << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; + << "<Unknown File>:2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; QTest::newRow("fill - anchor to non parent/sibling") << "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.fill: rect} }" - << "file::2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; + << "<Unknown File>:2:45: QML Rectangle: Cannot anchor to an item that isn't a parent or sibling."; } void tst_qdeclarativeanchors::reset() diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp index d9a6fe63..b3d1ca47 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp +++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp @@ -293,10 +293,10 @@ void tst_qdeclarativeanimatedimage::invalidSource() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine); - component.setData("import QtQuick 1.0\n AnimatedImage { source: \"no-such-file.gif\" }", QUrl::fromLocalFile("")); + component.setData("import QtQuick 1.0\n AnimatedImage { source: \"no-such-file.gif\" }", QUrl::fromLocalFile("relative")); QVERIFY(component.isReady()); - QTest::ignoreMessage(QtWarningMsg, "file::2:2: QML AnimatedImage: Error Reading Animated Image File file:no-such-file.gif"); + QTest::ignoreMessage(QtWarningMsg, "file:relative:2:2: QML AnimatedImage: Error Reading Animated Image File file:no-such-file.gif"); QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create()); QVERIFY(anim); diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp index 6c2e0312..e95a8307 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp +++ b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp @@ -115,10 +115,10 @@ void tst_qdeclarativeborderimage::imageSource_data() QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << false << ""; QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << false - << "file::2:1: QML BorderImage: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); + << "<Unknown File>:2:1: QML BorderImage: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << ""; QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true - << "file::2:1: QML BorderImage: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; + << "<Unknown File>:2:1: QML BorderImage: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; } void tst_qdeclarativeborderimage::imageSource() diff --git a/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp b/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp index bc46a2df..bed4efa5 100644 --- a/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp +++ b/tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp @@ -337,7 +337,7 @@ void tst_qdeclarativecontext::setContextProperty() QDeclarativeContext ctxt(engine.rootContext()); ctxt.setContextProperty("ctxtProp", QVariant()); - QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: TypeError: Result of expression 'ctxtProp' [undefined] is not an object."); + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:1: TypeError: Result of expression 'ctxtProp' [undefined] is not an object."); QObject *obj = component.create(&ctxt); QVariant v = obj->property("obj"); diff --git a/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp b/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp index ec0d5a75..8535e44a 100644 --- a/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp +++ b/tests/auto/declarative/qdeclarativeengine/tst_qdeclarativeengine.cpp @@ -268,7 +268,7 @@ void tst_qdeclarativeengine::outputWarningsToStandardError() delete o; QCOMPARE(warnings.count(), 1); - QCOMPARE(warnings.at(0), QLatin1String("<Unknown File>: Unable to assign [undefined] to int a")); + QCOMPARE(warnings.at(0), QLatin1String("<Unknown File>:1: Unable to assign [undefined] to int a")); warnings.clear(); diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp index c8a98d33..ae6f55ee 100644 --- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp +++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp @@ -434,11 +434,11 @@ void tst_qdeclarativeflickable::testQtQuick11Attributes_data() QTest::addColumn<QString>("error"); QTest::newRow("resizeContent") << "Component.onCompleted: resizeContent(100,100,Qt.point(50,50))" - << "<Unknown File>: ReferenceError: Can't find variable: resizeContent" + << "<Unknown File>:1: ReferenceError: Can't find variable: resizeContent" << ""; QTest::newRow("returnToBounds") << "Component.onCompleted: returnToBounds()" - << "<Unknown File>: ReferenceError: Can't find variable: returnToBounds" + << "<Unknown File>:1: ReferenceError: Can't find variable: returnToBounds" << ""; } diff --git a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp index fde77813..a158966a 100644 --- a/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp +++ b/tests/auto/declarative/qdeclarativefontloader/tst_qdeclarativefontloader.cpp @@ -140,7 +140,7 @@ void tst_qdeclarativefontloader::failLocalFont() const QString componentStr = QStringLiteral("import QtQuick 1.0\nFontLoader { source: \"") + urlString + QStringLiteral("\" }"); - const QByteArray message = QByteArrayLiteral("file::2:1: QML FontLoader: Cannot load font: \"") + const QByteArray message = QByteArrayLiteral("<Unknown File>:2:1: QML FontLoader: Cannot load font: \"") + urlString.toUtf8() + '"'; QTest::ignoreMessage(QtWarningMsg, message.constData()); QDeclarativeComponent component(&engine); @@ -186,7 +186,7 @@ void tst_qdeclarativefontloader::redirWebFont() void tst_qdeclarativefontloader::failWebFont() { QString componentStr = "import QtQuick 1.0\nFontLoader { source: \"http://localhost:14448/nonexist.ttf\" }"; - QTest::ignoreMessage(QtWarningMsg, "file::2:1: QML FontLoader: Cannot load font: \"http://localhost:14448/nonexist.ttf\""); + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:2:1: QML FontLoader: Cannot load font: \"http://localhost:14448/nonexist.ttf\""); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarativeFontLoader *fontObject = qobject_cast<QDeclarativeFontLoader*>(component.create()); diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index 68873872..01b3d042 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -2058,11 +2058,11 @@ void tst_QDeclarativeGridView::testQtQuick11Attributes_data() QTest::addColumn<QString>("error"); QTest::newRow("positionViewAtBeginning") << "Component.onCompleted: positionViewAtBeginning()" - << "<Unknown File>: ReferenceError: Can't find variable: positionViewAtBeginning" + << "<Unknown File>:1: ReferenceError: Can't find variable: positionViewAtBeginning" << ""; QTest::newRow("positionViewAtEnd") << "Component.onCompleted: positionViewAtEnd()" - << "<Unknown File>: ReferenceError: Can't find variable: positionViewAtEnd" + << "<Unknown File>:1: ReferenceError: Can't find variable: positionViewAtEnd" << ""; } diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 258d8299..bda7fd6f 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -137,15 +137,15 @@ void tst_qdeclarativeimage::imageSource_data() QTest::newRow("local no cache") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << 120.0 << 120.0 << false << false << false << ""; QTest::newRow("local async") << QUrl::fromLocalFile(SRCDIR "/data/colors1.png").toString() << 120.0 << 120.0 << false << true << true << ""; QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << 0.0 << 0.0 << false - << false << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); + << false << true << "<Unknown File>:2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString(); QTest::newRow("local async not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString() << 0.0 << 0.0 << false - << true << true << "file::2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString(); + << true << true << "<Unknown File>:2:1: QML Image: Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString(); QTest::newRow("remote") << SERVER_ADDR "/colors.png" << 120.0 << 120.0 << true << false << true << ""; QTest::newRow("remote redirected") << SERVER_ADDR "/oldcolors.png" << 120.0 << 120.0 << true << false << false << ""; if (QImageReader::supportedImageFormats().contains("SVG")) QTest::newRow("remote svg") << SERVER_ADDR "/heart.svg" << 550.0 << 500.0 << true << false << false << ""; QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << 0.0 << 0.0 << true - << false << true << "file::2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; + << false << true << "<Unknown File>:2:1: QML Image: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; } diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index a4b305c8..6a32a958 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -200,11 +200,11 @@ void tst_qdeclarativeimageprovider::fillRequestTestsData(const QString &id) QTest::newRow(QTest::toString(id + " missing")) << "image://test/no-such-file.png" << "no-such-file.png" << "" << QSize(100,100) - << "file::2:1: QML Image: Failed to get image from provider: image://test/no-such-file.png"; + << "<Unknown File>:2:1: QML Image: Failed to get image from provider: image://test/no-such-file.png"; QTest::newRow(QTest::toString(id + " unknown provider")) << "image://bogus/exists.png" << "" << "" << QSize() - << "file::2:1: QML Image: Failed to get image from provider: image://bogus/exists.png"; + << "<Unknown File>:2:1: QML Image: Failed to get image from provider: image://bogus/exists.png"; } void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvider *provider) @@ -344,7 +344,7 @@ void tst_qdeclarativeimageprovider::removeProvider() // remove the provider and confirm QString fileName = newImageFileName(); - QString error("file::2:1: QML Image: Failed to get image from provider: " + fileName); + QString error("<Unknown File>:2:1: QML Image: Failed to get image from provider: " + fileName); QTest::ignoreMessage(QtWarningMsg, error.toUtf8()); engine.removeImageProvider("test"); diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index 046f113b..eb8b0a43 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -558,7 +558,7 @@ void tst_QDeclarativeItem::layoutMirroringIllegalParent() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 1.1; QtObject { LayoutMirroring.enabled: true; LayoutMirroring.childrenInherit: true }", QUrl::fromLocalFile("")); - QTest::ignoreMessage(QtWarningMsg, "file::1:21: QML QtObject: LayoutDirection attached property only works with Items"); + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:1:21: QML QtObject: LayoutDirection attached property only works with Items"); QObject *object = component.create(); QVERIFY(object != 0); } diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index eb0e0948..6e56997e 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -2500,11 +2500,11 @@ void tst_QDeclarativeListView::testQtQuick11Attributes_data() QTest::addColumn<QString>("error"); QTest::newRow("positionViewAtBeginning") << "Component.onCompleted: positionViewAtBeginning()" - << "<Unknown File>: ReferenceError: Can't find variable: positionViewAtBeginning" + << "<Unknown File>:1: ReferenceError: Can't find variable: positionViewAtBeginning" << ""; QTest::newRow("positionViewAtEnd") << "Component.onCompleted: positionViewAtEnd()" - << "<Unknown File>: ReferenceError: Can't find variable: positionViewAtEnd" + << "<Unknown File>:1: ReferenceError: Can't find variable: positionViewAtEnd" << ""; } diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp index dc98fcde..a78c1496 100644 --- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp +++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp @@ -1119,13 +1119,13 @@ void tst_QDeclarativePositioners::test_conflictinganchors() component.setData("import QtQuick 1.0\nColumn { Item { anchors.top: parent.top } }", QUrl::fromLocalFile("")); item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); - QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column")); + QCOMPARE(warningMessage, QString("<Unknown File>:2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column")); warningMessage.clear(); component.setData("import QtQuick 1.0\nColumn { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile("")); item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); - QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column")); + QCOMPARE(warningMessage, QString("<Unknown File>:2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column")); warningMessage.clear(); component.setData("import QtQuick 1.0\nColumn { Item { anchors.left: parent.left } }", QUrl::fromLocalFile("")); @@ -1137,13 +1137,13 @@ void tst_QDeclarativePositioners::test_conflictinganchors() component.setData("import QtQuick 1.0\nRow { Item { anchors.left: parent.left } }", QUrl::fromLocalFile("")); item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); - QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row")); + QCOMPARE(warningMessage, QString("<Unknown File>:2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row")); warningMessage.clear(); component.setData("import QtQuick 1.0\nRow { Item { anchors.fill: parent } }", QUrl::fromLocalFile("")); item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); - QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row")); + QCOMPARE(warningMessage, QString("<Unknown File>:2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row")); warningMessage.clear(); component.setData("import QtQuick 1.0\nRow { Item { anchors.top: parent.top } }", QUrl::fromLocalFile("")); @@ -1155,24 +1155,24 @@ void tst_QDeclarativePositioners::test_conflictinganchors() component.setData("import QtQuick 1.0\nGrid { Item { anchors.horizontalCenter: parent.horizontalCenter } }", QUrl::fromLocalFile("")); item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); - QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid")); + QCOMPARE(warningMessage, QString("<Unknown File>:2:1: QML Grid: Cannot specify anchors for items inside Grid")); warningMessage.clear(); component.setData("import QtQuick 1.0\nGrid { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile("")); item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); - QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid")); + QCOMPARE(warningMessage, QString("<Unknown File>:2:1: QML Grid: Cannot specify anchors for items inside Grid")); warningMessage.clear(); component.setData("import QtQuick 1.0\nFlow { Item { anchors.verticalCenter: parent.verticalCenter } }", QUrl::fromLocalFile("")); item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); - QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow")); + QCOMPARE(warningMessage, QString("<Unknown File>:2:1: QML Flow: Cannot specify anchors for items inside Flow")); component.setData("import QtQuick 1.0\nFlow { Item { anchors.fill: parent } }", QUrl::fromLocalFile("")); item = qobject_cast<QDeclarativeItem*>(component.create()); QVERIFY(item); - QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow")); + QCOMPARE(warningMessage, QString("<Unknown File>:2:1: QML Flow: Cannot specify anchors for items inside Flow")); qInstallMessageHandler(oldMsgHandler); } diff --git a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp index 10d2bad6..10f56728 100644 --- a/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp +++ b/tests/auto/declarative/qdeclarativerepeater/tst_qdeclarativerepeater.cpp @@ -664,7 +664,7 @@ void tst_QDeclarativeRepeater::testQtQuick11Attributes_data() << ":1 \"Repeater.onItemRemoved\" is not available in QtQuick 1.0.\n"; QTest::newRow("itemAt") << "Component.onCompleted: itemAt(0)" - << "<Unknown File>: ReferenceError: Can't find variable: itemAt" + << "<Unknown File>:1: ReferenceError: Can't find variable: itemAt" << ""; } diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp index 0bb1e486..2bdc99de 100644 --- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp +++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp @@ -1307,11 +1307,11 @@ void tst_qdeclarativetext::testQtQuick11Attributes_data() << ":1 \"Text.lineHeightMode\" is not available in QtQuick 1.0.\n"; QTest::newRow("lineCount") << "property int foo: lineCount" - << "<Unknown File>: ReferenceError: Can't find variable: lineCount" + << "<Unknown File>:1: ReferenceError: Can't find variable: lineCount" << ""; QTest::newRow("truncated") << "property bool foo: truncated" - << "<Unknown File>: ReferenceError: Can't find variable: truncated" + << "<Unknown File>:1: ReferenceError: Can't find variable: truncated" << ""; } diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 7b0c650e..ebdbee39 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -2473,19 +2473,19 @@ void tst_qdeclarativetextedit::testQtQuick11Attributes_data() QTest::addColumn<QString>("error"); QTest::newRow("canPaste") << "property bool foo: canPaste" - << "<Unknown File>: ReferenceError: Can't find variable: canPaste" + << "<Unknown File>:1: ReferenceError: Can't find variable: canPaste" << ""; QTest::newRow("lineCount") << "property int foo: lineCount" - << "<Unknown File>: ReferenceError: Can't find variable: lineCount" + << "<Unknown File>:1: ReferenceError: Can't find variable: lineCount" << ""; QTest::newRow("moveCursorSelection") << "Component.onCompleted: moveCursorSelection(0, TextEdit.SelectCharacters)" - << "<Unknown File>: ReferenceError: Can't find variable: moveCursorSelection" + << "<Unknown File>:1: ReferenceError: Can't find variable: moveCursorSelection" << ""; QTest::newRow("deselect") << "Component.onCompleted: deselect()" - << "<Unknown File>: ReferenceError: Can't find variable: deselect" + << "<Unknown File>:1: ReferenceError: Can't find variable: deselect" << ""; QTest::newRow("onLinkActivated") << "onLinkActivated: {}" diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 066c0cfa..a53dd1a6 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -2440,15 +2440,15 @@ void tst_qdeclarativetextinput::testQtQuick11Attributes_data() QTest::addColumn<QString>("error"); QTest::newRow("canPaste") << "property bool foo: canPaste" - << "<Unknown File>: ReferenceError: Can't find variable: canPaste" + << "<Unknown File>:1: ReferenceError: Can't find variable: canPaste" << ""; QTest::newRow("moveCursorSelection") << "Component.onCompleted: moveCursorSelection(0, TextEdit.SelectCharacters)" - << "<Unknown File>: ReferenceError: Can't find variable: moveCursorSelection" + << "<Unknown File>:1: ReferenceError: Can't find variable: moveCursorSelection" << ""; QTest::newRow("deselect") << "Component.onCompleted: deselect()" - << "<Unknown File>: ReferenceError: Can't find variable: deselect" + << "<Unknown File>:1: ReferenceError: Can't find variable: deselect" << ""; } |