diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-04-19 15:54:47 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-04-19 22:59:43 +0000 |
commit | 924b02aecbce4843ff9d0a7d1d15f1eb154f5d69 (patch) | |
tree | cec9028953247bf522116cc7ae009df1523dc493 /tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp | |
parent | 80432021146d62ec6ffd0798f2228f741f0b9fad (diff) |
Revert "Initialize QLoggingRegistry rules on first use, not qApp construction"
This reverts commit 47cc9e23a313d67a4a3107242f205d2473842021.
We use QCoreApplication::applicationDirPath in the logging initialization to find
a possible qtlogging.ini file. Because QCoreApplication::applicationDirPath requires
a QCoreApplication instance this leads to a qWarning, which in turn leads to a
recursive call to the logging initialization, and in turn to a recursive mutex deadlock.
Task-number: QTCREATORBUG-18031
Change-Id: Ic75e1e8c062eb647991725378489bf87c9648cca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp')
-rw-r--r-- | tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp index c697cb2203..0a74dc64c0 100644 --- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp +++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp @@ -197,23 +197,9 @@ private slots: // Check whether QT_LOGGING_CONF is picked up from environment // - Q_ASSERT(!qApp); - - qputenv("QT_LOGGING_RULES", "qt.foo.bar=true"); + qputenv("QT_LOGGING_CONF", QFINDTESTDATA("qtlogging.ini").toLocal8Bit()); QLoggingRegistry registry; - QCOMPARE(registry.apiRules.size(), 0); - QCOMPARE(registry.configRules.size(), 0); - QCOMPARE(registry.envRules.size(), 1); - QCOMPARE(registry.rules.size(), 1); - - QLoggingCategory qtEnabledByLoggingRule("qt.foo.bar"); - QCOMPARE(qtEnabledByLoggingRule.isDebugEnabled(), true); - QLoggingCategory qtDisabledByDefault("qt.foo.baz"); - QCOMPARE(qtDisabledByDefault.isDebugEnabled(), false); - - qunsetenv("QT_LOGGING_RULES"); - qputenv("QT_LOGGING_CONF", QFINDTESTDATA("qtlogging.ini").toLocal8Bit()); registry.init(); QCOMPARE(registry.apiRules.size(), 0); @@ -318,6 +304,6 @@ private slots: } }; -QTEST_APPLESS_MAIN(tst_QLoggingRegistry) +QTEST_MAIN(tst_QLoggingRegistry) #include "tst_qloggingregistry.moc" |