diff options
Diffstat (limited to 'tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp')
-rw-r--r-- | tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp index d2bfdb54ca..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> @@ -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) |