diff options
Diffstat (limited to 'tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp')
-rw-r--r-- | tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp index a2363eedfc..476ca275a4 100644 --- a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp +++ b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QMutexLocker> @@ -78,7 +78,7 @@ public: { QString ret; QTextStream out(&ret); - for (int a = 0; a < _configitemEntryOrder.count(); a++) { + for (int a = 0; a < _configitemEntryOrder.size(); a++) { out << _configitemEntryOrder[a] << " = " << _values.value(_configitemEntryOrder[a]) << Qt::endl; @@ -903,7 +903,7 @@ private slots: buf = QStringLiteral("Digia.Berlin.Office.com.debug: Berlin \"from Thread 2\" :false"); compareagainst.append(cleanLogLine(buf)); - for (int i = 0; i < threadtest.count(); i++) { + for (int i = 0; i < threadtest.size(); i++) { if (!compareagainst.contains(cleanLogLine(threadtest[i]))){ fprintf(stdout, "%s\r\n", threadtest[i].toLatin1().constData()); QVERIFY2(false, "Multithread log is not complete!"); @@ -916,6 +916,23 @@ private slots: delete _config; qInstallMessageHandler(oldMessageHandler); } + + void qFatalMacros() + { + QLoggingCategory customCategory("custom"); + + // compile-only test for fatal macros + return; + + qFatal("Message"); + qFatal("Message %d", 42); + qFatal(customCategory, "Message %d", 42); + qFatal(TST_LOG, "Message %d", 42); + + qFatal() << "Message" << 42; + qCFatal(customCategory) << "Message" << 42; + qCFatal(TST_LOG) << "Message" << 42; + } }; QTEST_MAIN(tst_QLogging) |