From b11adb825c4dfc8429695947cef8f9e3253ad0c2 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 17 Mar 2014 10:16:08 +0100 Subject: Logging: Be also more strict with value of logging rule Only accept lower-case "true" and "false", as documented. The old check didn't match either the documentation, nor the QSettings/ QVariant behavior (where, for a boolean value, any lower-cased content that not empty, "0" or "false" is considered true). Change-Id: I317d29c16a27f862001b9dff02e8298df8acf5a6 Reviewed-by: Friedemann Kleint Reviewed-by: Alex Blasche --- tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp index 3064fd1320..5623990bd1 100644 --- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp +++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp @@ -306,10 +306,13 @@ private slots: void QLoggingRegistry_checkErrors() { QLoggingSettingsParser parser; - QString warnMsg = QString("Ignoring malformed logging rule: '***=false'"); - QTest::ignoreMessage(QtWarningMsg, warnMsg.toLocal8Bit().constData()); + QTest::ignoreMessage(QtWarningMsg, "Ignoring malformed logging rule: '***=false'"); + QTest::ignoreMessage(QtWarningMsg, "Ignoring malformed logging rule: '*=0'"); + QTest::ignoreMessage(QtWarningMsg, "Ignoring malformed logging rule: '*=TRUE'"); parser.setContent("[Rules]\n" - "***=false\n"); + "***=false\n" + "*=0\n" + "*=TRUE\n"); QVERIFY(parser.rules().isEmpty()); } }; -- cgit v1.2.3