aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
diff options
context:
space:
mode:
authorTomasz Olszak <olszak.tomasz@gmail.com>2018-03-22 11:25:59 +0100
committerTomasz Olszak <olszak.tomasz@gmail.com>2018-06-25 10:25:40 +0000
commitf319fcf70917c392913cf6db6115d18623dd4fd5 (patch)
tree22ebe95ccd8076b1f7b17ba12e3c86b4347da128 /tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
parent8597f74e520c18e0ac1c7a90e02a3b5ba33d4753 (diff)
Add defaultLogLevel to LoggingCategory
Add possibility to define default logging category log level. Just like in QLoggingCategory constructor. [ChangeLog][QML Elements][LoggingCategory] Added defaultLogLevel property. It is possible to define default log level that LoggingCategory is enabled for. Task-number: QTBUG-67094 Change-Id: I12557dfb7c228c40b325d0dccde4c525acae0300 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp')
-rw-r--r--tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
index 40a9295e50..77805bbbac 100644
--- a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
+++ b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp
@@ -112,8 +112,13 @@ void tst_qqmlconsole::categorized_logging()
QVERIFY(messageHandler.messages().contains("qt.test: console.info"));
QVERIFY(messageHandler.messages().contains("qt.test: console.warn"));
QVERIFY(messageHandler.messages().contains("qt.test: console.error"));
+ QVERIFY(!messageHandler.messages().contains("qt.test.warning: console.debug"));
+ QVERIFY(!messageHandler.messages().contains("qt.test.warning: console.log"));
+ QVERIFY(!messageHandler.messages().contains("qt.test.warning: console.info"));
+ QVERIFY(messageHandler.messages().contains("qt.test.warning: console.warn"));
+ QVERIFY(messageHandler.messages().contains("qt.test.warning: console.error"));
- QString emptyCategory = "default: " + QString::fromLatin1("%1:%2:%3: ").arg(testUrl.toString()).arg(50).arg(5) +
+ QString emptyCategory = "default: " + QString::fromLatin1("%1:%2:%3: ").arg(testUrl.toString()).arg(56).arg(5) +
"QML LoggingCategory: Declaring the name of the LoggingCategory is mandatory and cannot be changed later !";
QVERIFY(messageHandler.messages().contains(emptyCategory));
@@ -121,7 +126,11 @@ void tst_qqmlconsole::categorized_logging()
"QML LoggingCategory: The name of a LoggingCategory cannot be changed after the Item is created";
QVERIFY(messageHandler.messages().contains(changedCategory));
- QString useEmptyCategory = "default: " + QString::fromLatin1("%1:%2: ").arg(testUrl.toString()).arg(63) +
+ QString changedDefaultLogLevel = "default: " + QString::fromLatin1("%1:%2:%3: ").arg(testUrl.toString()).arg(45).arg(5) +
+ "QML LoggingCategory: The defaultLogLevel of a LoggingCategory cannot be changed after the Item is created";
+ QVERIFY(messageHandler.messages().contains(changedDefaultLogLevel));
+
+ QString useEmptyCategory = "default: " + QString::fromLatin1("%1:%2: ").arg(testUrl.toString()).arg(75) +
"Error: A QmlLoggingCatgory was provided without a valid name";
QVERIFY(messageHandler.messages().contains(useEmptyCategory));