diff options
author | Tarja Sundqvist <[email protected]> | 2023-03-23 16:00:07 +0200 |
---|---|---|
committer | Tarja Sundqvist <[email protected]> | 2023-03-23 16:00:07 +0200 |
commit | 19ed7973a311a8d42d3a558bb551230e902ce9b9 (patch) | |
tree | 9832c0cc796722f85579e25fd50cc38b65e6ef6c /tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp | |
parent | f5701f0def37fcc0c2b38ae9552eb3a896a34687 (diff) | |
parent | a5635345175e667601c8b6a344508c4d4ebb0f9d (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into tqtc/lts-5.15-opensourcev5.15.9-lts-lgpl
Change-Id: I91d2b178e7111d0802ea973bccf230b264c30c96
Diffstat (limited to 'tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp')
-rw-r--r-- | tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp index 48613d04f1..3a25dfb10d 100644 --- a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp +++ b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp @@ -134,18 +134,27 @@ void tst_qqmlconsole::categorized_logging() QVERIFY(messageHandler.messages().contains("qt.test.warning: console.error")); 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 !"; + "QML LoggingCategory: Declaring the name of a LoggingCategory is mandatory and cannot be changed later"; QVERIFY(messageHandler.messages().contains(emptyCategory)); - QString changedCategory = "default: " + QString::fromLatin1("%1:%2:%3: ").arg(testUrl.toString()).arg(45).arg(5) + - "QML LoggingCategory: The name of a LoggingCategory cannot be changed after the Item is created"; + + QString notChangedCategory = "default: " + QString::fromLatin1("%1:%2:%3: ").arg(testUrl.toString()).arg(45).arg(5) + + "QML LoggingCategory: The name of a LoggingCategory cannot be changed after the component is completed"; + QVERIFY(!messageHandler.messages().contains(notChangedCategory)); + QString changedCategory = "default: " + QString::fromLatin1("%1:%2:%3: ").arg(testUrl.toString()).arg(50).arg(5) + + "QML LoggingCategory: The name of a LoggingCategory cannot be changed after the component is completed"; QVERIFY(messageHandler.messages().contains(changedCategory)); - 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"; + + QString notChangedDefaultLogLevel = "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 component is completed"; + QVERIFY(!messageHandler.messages().contains(notChangedDefaultLogLevel)); + QString changedDefaultLogLevel = "default: " + QString::fromLatin1("%1:%2:%3: ").arg(testUrl.toString()).arg(50).arg(5) + + "QML LoggingCategory: The defaultLogLevel of a LoggingCategory cannot be changed after the component is completed"; QVERIFY(messageHandler.messages().contains(changedDefaultLogLevel)); - QString useEmptyCategory = "default: " + QString::fromLatin1("%1:%2: ").arg(testUrl.toString()).arg(75) + + + QString useEmptyCategory = "default: " + QString::fromLatin1("%1:%2: ").arg(testUrl.toString()).arg(78) + "Error: A QmlLoggingCatgory was provided without a valid name"; QVERIFY(messageHandler.messages().contains(useEmptyCategory)); @@ -188,11 +197,11 @@ void tst_qqmlconsole::testAssert() // assert() QString assert1 = "This will fail\n" + - QString::fromLatin1("onCompleted (%1:%2)").arg(testUrl.toString()).arg(41); + QString::fromLatin1("onCompleted (%1:%2)").arg(testUrl.toString()).arg(42); QString assert2 = "This will fail too\n" + - QString::fromLatin1("assertFail (%1:%2)\n").arg(testUrl.toString()).arg(34) + - QString::fromLatin1("onCompleted (%1:%2)").arg(testUrl.toString()).arg(46); + QString::fromLatin1("assertFail (%1:%2)\n").arg(testUrl.toString()).arg(35) + + QString::fromLatin1("onCompleted (%1:%2)").arg(testUrl.toString()).arg(47); QTest::ignoreMessage(QtCriticalMsg, qPrintable(assert1)); QTest::ignoreMessage(QtCriticalMsg, qPrintable(assert2)); |