aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2014-07-11 16:15:01 +0200
committerDavid Faure <david.faure@kdab.com>2014-07-24 15:15:43 +0200
commitaad255f6d5e79f496e93c9e758504a1d2c8a2467 (patch)
tree02a1b6f1225b985bcd9b42e593203d18d0cfce0a
parenta38b0863f88bc89733c213cf6f73abc7ed15bd5a (diff)
QQmlError::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: I91918090fd4e0aa9a25dbbb18893a0ce94140e21 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--src/qml/qml/qqmlerror.cpp11
-rw-r--r--src/qml/qml/qqmlinfo.cpp2
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp2
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp2
-rw-r--r--tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp2
-rw-r--r--tests/auto/quick/qquickanchors/tst_qquickanchors.cpp22
-rw-r--r--tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp4
-rw-r--r--tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp4
-rw-r--r--tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp4
-rw-r--r--tests/auto/quick/qquickimage/tst_qquickimage.cpp6
-rw-r--r--tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp6
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp2
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp16
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp8
14 files changed, 46 insertions, 45 deletions
diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qml/qqmlerror.cpp
index c583156c43..6d72bfcffa 100644
--- a/src/qml/qml/qqmlerror.cpp
+++ b/src/qml/qml/qqmlerror.cpp
@@ -249,16 +249,17 @@ QString QQmlError::toString() const
QUrl u(url());
int l(line());
- if (u.isEmpty()) {
+ if (u.isEmpty() || (u.isLocalFile() && u.path().isEmpty()))
rv = QLatin1String("<Unknown File>");
- } else if (l != -1) {
- rv = u.toString() + QLatin1Char(':') + QString::number(l);
+ else
+ rv = u.toString();
+
+ if (l != -1) {
+ rv += QLatin1Char(':') + QString::number(l);
int c(column());
if (c != -1)
rv += QLatin1Char(':') + QString::number(c);
- } else {
- rv = u.toString();
}
rv += QLatin1String(": ") + description();
diff --git a/src/qml/qml/qqmlinfo.cpp b/src/qml/qml/qqmlinfo.cpp
index 63ce2d419c..2f013863ca 100644
--- a/src/qml/qml/qqmlinfo.cpp
+++ b/src/qml/qml/qqmlinfo.cpp
@@ -147,7 +147,7 @@ QQmlInfo::~QQmlInfo()
d->buffer.prepend(QLatin1String("QML ") + typeName + QLatin1String(": "));
QQmlData *ddata = QQmlData::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/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 553663ac22..147887109f 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -348,7 +348,7 @@ void tst_qqmlcontext::setContextProperty()
QQmlContext ctxt(engine.rootContext());
ctxt.setContextProperty("ctxtProp", QVariant());
- QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: TypeError: Cannot read property 'a' of undefined");
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:1: TypeError: Cannot read property 'a' of undefined");
QObject *obj = component.create(&ctxt);
QVariant v = obj->property("obj");
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index 004514d39c..23c50f940b 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -488,7 +488,7 @@ void tst_qqmlengine::outputWarningsToStandardError()
delete o;
QCOMPARE(messageHandler.messages().count(), 1);
- QCOMPARE(messageHandler.messages().at(0), QLatin1String("<Unknown File>: Unable to assign [undefined] to int"));
+ QCOMPARE(messageHandler.messages().at(0), QLatin1String("<Unknown File>:1:48: Unable to assign [undefined] to int"));
messageHandler.clear();
engine.setOutputWarningsToStandardError(false);
diff --git a/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp b/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
index b8c2ce4460..c0d66785bb 100644
--- a/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
+++ b/tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp
@@ -451,7 +451,7 @@ void tst_QQmlPropertyMap::disallowExtending()
obj.reset(component.create());
QVERIFY(obj.isNull());
QCOMPARE(component.errors().count(), 1);
- QCOMPARE(component.errors().at(0).toString(), QStringLiteral("<Unknown File>: Fully dynamic types cannot declare new properties."));
+ QCOMPARE(component.errors().at(0).toString(), QStringLiteral("<Unknown File>:3:1: Fully dynamic types cannot declare new properties."));
}
void tst_QQmlPropertyMap::QTBUG_35906()
diff --git a/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp b/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
index ee277ecd9b..02c30b652a 100644
--- a/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
+++ b/tests/auto/quick/qquickanchors/tst_qquickanchors.cpp
@@ -310,55 +310,55 @@ void tst_qquickanchors::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 horizontalCenter anchors at the same time.";
+ << "<Unknown File>:2:23: QML Rectangle: Cannot specify left, right, and horizontalCenter anchors at the same time.";
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 verticalCenter anchors at the same time.";
+ << "<Unknown File>:2:23: QML Rectangle: Cannot specify top, bottom, and verticalCenter anchors at the same time.";
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 verticalCenter anchors.";
+ << "<Unknown File>:2:47: QML Text: Baseline anchor cannot be used in conjunction with top, bottom, or verticalCenter 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_qquickanchors::reset()
diff --git a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
index 49bbb3a4c5..eb0ea7c8f5 100644
--- a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
+++ b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
@@ -305,10 +305,10 @@ void tst_qquickanimatedimage::invalidSource()
{
QQmlEngine engine;
QQmlComponent component(&engine);
- component.setData("import QtQuick 2.0\n AnimatedImage { source: \"no-such-file.gif\" }", QUrl::fromLocalFile(""));
+ component.setData("import QtQuick 2.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");
QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create());
QVERIFY(anim);
diff --git a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
index c02a5c7a87..ce4394cf6f 100644
--- a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
+++ b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
@@ -131,10 +131,10 @@ void tst_qquickborderimage::imageSource_data()
QTest::newRow("local") << testFileUrl("colors.png").toString() << false << "";
QTest::newRow("local not found") << testFileUrl("no-such-file.png").toString() << false
- << "file::2:1: QML BorderImage: Cannot open: " + testFileUrl("no-such-file.png").toString();
+ << "<Unknown File>:2:1: QML BorderImage: Cannot open: " + testFileUrl("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_qquickborderimage::imageSource()
diff --git a/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp b/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp
index 5c2bbf1650..225cdb5389 100644
--- a/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp
+++ b/tests/auto/quick/qquickfontloader/tst_qquickfontloader.cpp
@@ -130,7 +130,7 @@ void tst_qquickfontloader::localFont()
void tst_qquickfontloader::failLocalFont()
{
QString componentStr = "import QtQuick 2.0\nFontLoader { source: \"" + testFileUrl("dummy.ttf").toString() + "\" }";
- QTest::ignoreMessage(QtWarningMsg, QString("file::2:1: QML FontLoader: Cannot load font: \"" + testFileUrl("dummy.ttf").toString() + "\"").toUtf8().constData());
+ QTest::ignoreMessage(QtWarningMsg, QString("<Unknown File>:2:1: QML FontLoader: Cannot load font: \"" + testFileUrl("dummy.ttf").toString() + "\"").toUtf8().constData());
QQmlComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickFontLoader *fontObject = qobject_cast<QQuickFontLoader*>(component.create());
@@ -174,7 +174,7 @@ void tst_qquickfontloader::redirWebFont()
void tst_qquickfontloader::failWebFont()
{
QString componentStr = "import QtQuick 2.0\nFontLoader { source: \"" SERVER_ADDR "/nonexist.ttf\" }";
- QTest::ignoreMessage(QtWarningMsg, "file::2:1: QML FontLoader: Cannot load font: \"" SERVER_ADDR "/nonexist.ttf\"");
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:2:1: QML FontLoader: Cannot load font: \"" SERVER_ADDR "/nonexist.ttf\"");
QQmlComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickFontLoader *fontObject = qobject_cast<QQuickFontLoader*>(component.create());
diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
index 7951cb07cf..58acc19f42 100644
--- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp
+++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
@@ -153,9 +153,9 @@ void tst_qquickimage::imageSource_data()
QTest::newRow("local no cache") << testFileUrl("colors.png").toString() << 120.0 << 120.0 << false << false << false << "";
QTest::newRow("local async") << testFileUrl("colors1.png").toString() << 120.0 << 120.0 << false << true << true << "";
QTest::newRow("local not found") << testFileUrl("no-such-file.png").toString() << 0.0 << 0.0 << false
- << false << true << "file::2:1: QML Image: Cannot open: " + testFileUrl("no-such-file.png").toString();
+ << false << true << "<Unknown File>:2:1: QML Image: Cannot open: " + testFileUrl("no-such-file.png").toString();
QTest::newRow("local async not found") << testFileUrl("no-such-file-1.png").toString() << 0.0 << 0.0 << false
- << true << true << "file::2:1: QML Image: Cannot open: " + testFileUrl("no-such-file-1.png").toString();
+ << true << true << "<Unknown File>:2:1: QML Image: Cannot open: " + testFileUrl("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"))
@@ -163,7 +163,7 @@ void tst_qquickimage::imageSource_data()
if (QImageReader::supportedImageFormats().contains("svgz"))
QTest::newRow("remote svgz") << SERVER_ADDR "/heart.svgz" << 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/quick/qquickimageprovider/tst_qquickimageprovider.cpp b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
index 48af48b17b..be302241da 100644
--- a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
+++ b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
@@ -206,11 +206,11 @@ void tst_qquickimageprovider::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: Invalid image provider: image://bogus/exists.png";
+ << "<Unknown File>:2:1: QML Image: Invalid image provider: image://bogus/exists.png";
}
void tst_qquickimageprovider::runTest(bool async, QQuickImageProvider *provider)
@@ -364,7 +364,7 @@ void tst_qquickimageprovider::removeProvider()
// remove the provider and confirm
QString fileName = newImageFileName();
- QString error("file::2:1: QML Image: Invalid image provider: " + fileName);
+ QString error("<Unknown File>:2:1: QML Image: Invalid image provider: " + fileName);
QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
engine.removeImageProvider("test");
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index e7f0adb24d..305e18c2eb 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -1632,7 +1632,7 @@ void tst_QQuickItem::layoutMirroringIllegalParent()
{
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; 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/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
index e63ff6639e..035735914a 100644
--- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
+++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
@@ -1857,7 +1857,7 @@ void tst_qquickpositioners::test_conflictinganchors()
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(messageHandler.messages().size(), 1);
- QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function."));
+ QCOMPARE(messageHandler.messages().back(), QString("<Unknown File>:2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function."));
messageHandler.clear();
delete item;
@@ -1865,7 +1865,7 @@ void tst_qquickpositioners::test_conflictinganchors()
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(messageHandler.messages().size(), 1);
- QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function."));
+ QCOMPARE(messageHandler.messages().back(), QString("<Unknown File>:2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function."));
messageHandler.clear();
delete item;
@@ -1879,7 +1879,7 @@ void tst_qquickpositioners::test_conflictinganchors()
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(messageHandler.messages().size(), 1);
- QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function."));
+ QCOMPARE(messageHandler.messages().back(), QString("<Unknown File>:2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function."));
messageHandler.clear();
delete item;
@@ -1887,7 +1887,7 @@ void tst_qquickpositioners::test_conflictinganchors()
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(messageHandler.messages().size(), 1);
- QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function."));
+ QCOMPARE(messageHandler.messages().back(), QString("<Unknown File>:2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row. Row will not function."));
messageHandler.clear();
delete item;
@@ -1901,7 +1901,7 @@ void tst_qquickpositioners::test_conflictinganchors()
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(messageHandler.messages().size(), 1);
- QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function."));
+ QCOMPARE(messageHandler.messages().back(), QString("<Unknown File>:2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function."));
messageHandler.clear();
delete item;
@@ -1909,7 +1909,7 @@ void tst_qquickpositioners::test_conflictinganchors()
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(messageHandler.messages().size(), 1);
- QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function."));
+ QCOMPARE(messageHandler.messages().back(), QString("<Unknown File>:2:1: QML Grid: Cannot specify anchors for items inside Grid. Grid will not function."));
messageHandler.clear();
delete item;
@@ -1917,7 +1917,7 @@ void tst_qquickpositioners::test_conflictinganchors()
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(messageHandler.messages().size(), 1);
- QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function."));
+ QCOMPARE(messageHandler.messages().back(), QString("<Unknown File>:2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function."));
messageHandler.clear();
delete item;
@@ -1925,7 +1925,7 @@ void tst_qquickpositioners::test_conflictinganchors()
item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item);
QCOMPARE(messageHandler.messages().size(), 1);
- QCOMPARE(messageHandler.messages().back(), QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function."));
+ QCOMPARE(messageHandler.messages().back(), QString("<Unknown File>:2:1: QML Flow: Cannot specify anchors for items inside Flow. Flow will not function."));
delete item;
}
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 6167577b60..1455f8cfcb 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -2813,7 +2813,7 @@ void tst_qquicktext::imgTagsAlign()
QFETCH(QString, align);
QString componentStr = "import QtQuick 2.0\nText { text: \"This is a test <img src=\\\"" + src + "\\\" align=\\\"" + align + "\\\"> of image.\" }";
QQmlComponent textComponent(&engine);
- textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("."));
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
@@ -2838,7 +2838,7 @@ void tst_qquicktext::imgTagsMultipleImages()
QString componentStr = "import QtQuick 2.0\nText { text: \"This is a starfish<img src=\\\"data/images/starfish_2.png\\\" width=\\\"60\\\" height=\\\"60\\\" > and another one<img src=\\\"data/images/heart200.png\\\" width=\\\"85\\\" height=\\\"85\\\">.\" }";
QQmlComponent textComponent(&engine);
- textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("."));
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);
@@ -2899,8 +2899,8 @@ void tst_qquicktext::imgTagsError()
QString componentStr = "import QtQuick 2.0\nText { text: \"This is a starfish<img src=\\\"data/images/starfish_2.pn\\\" width=\\\"60\\\" height=\\\"60\\\">.\" }";
QQmlComponent textComponent(&engine);
- QTest::ignoreMessage(QtWarningMsg, "file::2:1: QML Text: Cannot open: file:data/images/starfish_2.pn");
- textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
+ QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:2:1: QML Text: Cannot open: file:data/images/starfish_2.pn");
+ textComponent.setData(componentStr.toLatin1(), QUrl("file:"));
QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create());
QVERIFY(textObject != 0);