diff options
Diffstat (limited to 'tests/auto/qml/qqmlconsole')
-rw-r--r-- | tests/auto/qml/qqmlconsole/data/logging.qml | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlconsole/data/logging.qml b/tests/auto/qml/qqmlconsole/data/logging.qml index d55c99bcbd..0764ad7545 100644 --- a/tests/auto/qml/qqmlconsole/data/logging.qml +++ b/tests/auto/qml/qqmlconsole/data/logging.qml @@ -67,6 +67,8 @@ QtObject { console.log(1, "pong!", new Object); console.log(1, ["ping","pong"], new Object, 2); + console.log(contextStringListProperty); + try { console.log(exception); } catch (e) { diff --git a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp index 0d915f98f8..5391e19f50 100644 --- a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp +++ b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp @@ -29,6 +29,7 @@ #include <QDebug> #include <QQmlEngine> #include <QQmlComponent> +#include <QQmlContext> #include <QLoggingCategory> #include "../../shared/util.h" @@ -81,11 +82,15 @@ void tst_qqmlconsole::logging() // QTest::ignoreMessage(QtDebugMsg, "[object Object]"); QTest::ignoreMessage(QtDebugMsg, "1 pong! [object Object]"); QTest::ignoreMessage(QtDebugMsg, "1 [ping,pong] [object Object] 2"); + QTest::ignoreMessage(QtDebugMsg, "[Hello,World]"); + + QScopedPointer<QQmlContext> loggingContext(new QQmlContext(engine.rootContext())); + QStringList stringList; stringList << QStringLiteral("Hello") << QStringLiteral("World"); + loggingContext->setContextProperty("contextStringListProperty", stringList); QQmlComponent component(&engine, testUrl); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create(loggingContext.data())); QVERIFY(object != nullptr); - delete object; } void tst_qqmlconsole::categorized_logging() |