diff options
author | David Faure <david.faure@kdab.com> | 2014-07-11 16:15:01 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2014-07-24 15:15:43 +0200 |
commit | aad255f6d5e79f496e93c9e758504a1d2c8a2467 (patch) | |
tree | 02a1b6f1225b985bcd9b42e593203d18d0cfce0a /tests/auto/qml | |
parent | a38b0863f88bc89733c213cf6f73abc7ed15bd5a (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/qml')
-rw-r--r-- | tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
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() |