aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktext
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 /tests/auto/quick/qquicktext
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>
Diffstat (limited to 'tests/auto/quick/qquicktext')
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp8
1 files changed, 4 insertions, 4 deletions
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);