summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2013-09-27 13:37:37 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-06 19:47:31 +0200
commit32f27b4367c4e042a3f0cda671579494e31c1d69 (patch)
tree45b2433b6d321dd37a752b4be2cf7625ddcf5e4b /tests
parent09a11069e7b0aafcfccad78d7f69eeb1fadd5494 (diff)
Replace QLoggingCategory::isEnabled by non-template functions
This yields the same results as previously and is more in line with existing interfaces. Change-Id: I0bf0372bf18f3bfde579385cddbe594bf71e3c52 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
index 7ddb221402..df93262d93 100644
--- a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
+++ b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
@@ -69,6 +69,7 @@ QByteArray qMyMessageFormatString(QtMsgType type, const QMessageLogContext &cont
case QtWarningMsg: message.append(".warning"); break;
case QtCriticalMsg:message.append(".critical"); break;
case QtFatalMsg: message.append(".fatal"); break;
+ case QtTraceMsg: message.append(".trace"); break;
}
message.append(": ");
message.append(qPrintable(str));
@@ -255,27 +256,27 @@ private slots:
{
logMessage.clear();
- QCOMPARE(QLoggingCategory::defaultCategory().isEnabled<QtDebugMsg>(), true);
+ QCOMPARE(QLoggingCategory::defaultCategory().isDebugEnabled(), true);
QCOMPARE(QLoggingCategory::defaultCategory().isEnabled(QtDebugMsg), true);
- QCOMPARE(QLoggingCategory::defaultCategory().isEnabled<QtWarningMsg>(), true);
+ QCOMPARE(QLoggingCategory::defaultCategory().isWarningEnabled(), true);
QCOMPARE(QLoggingCategory::defaultCategory().isEnabled(QtWarningMsg), true);
- QCOMPARE(QLoggingCategory::defaultCategory().isEnabled<QtCriticalMsg>(), true);
+ QCOMPARE(QLoggingCategory::defaultCategory().isCriticalEnabled(), true);
QCOMPARE(QLoggingCategory::defaultCategory().isEnabled(QtCriticalMsg), true);
QLoggingCategory defaultCategory("default");
- QCOMPARE(defaultCategory.isEnabled<QtDebugMsg>(), true);
+ QCOMPARE(defaultCategory.isDebugEnabled(), true);
QCOMPARE(defaultCategory.isEnabled(QtDebugMsg), true);
- QCOMPARE(defaultCategory.isEnabled<QtWarningMsg>(), true);
+ QCOMPARE(defaultCategory.isWarningEnabled(), true);
QCOMPARE(defaultCategory.isEnabled(QtWarningMsg), true);
- QCOMPARE(defaultCategory.isEnabled<QtCriticalMsg>(), true);
+ QCOMPARE(defaultCategory.isCriticalEnabled(), true);
QCOMPARE(defaultCategory.isEnabled(QtCriticalMsg), true);
QLoggingCategory customCategory("custom");
- QCOMPARE(customCategory.isEnabled<QtDebugMsg>(), false);
+ QCOMPARE(customCategory.isDebugEnabled(), false);
QCOMPARE(customCategory.isEnabled(QtDebugMsg), false);
- QCOMPARE(customCategory.isEnabled<QtWarningMsg>(), true);
+ QCOMPARE(customCategory.isWarningEnabled(), true);
QCOMPARE(customCategory.isEnabled(QtWarningMsg), true);
- QCOMPARE(customCategory.isEnabled<QtCriticalMsg>(), true);
+ QCOMPARE(customCategory.isCriticalEnabled(), true);
QCOMPARE(customCategory.isEnabled(QtCriticalMsg), true);
// make sure nothing has printed warnings
@@ -286,10 +287,10 @@ private slots:
{
logMessage.clear();
- QCOMPARE(QLoggingCategory::defaultCategory().isEnabled<QtDebugMsg>(), true);
+ QCOMPARE(QLoggingCategory::defaultCategory().isDebugEnabled(), true);
QLoggingCategory::defaultCategory().setEnabled(QtDebugMsg, false);
- QCOMPARE(QLoggingCategory::defaultCategory().isEnabled<QtDebugMsg>(), false);
+ QCOMPARE(QLoggingCategory::defaultCategory().isDebugEnabled(), false);
QLoggingCategory::defaultCategory().setEnabled(QtDebugMsg, true);
// make sure nothing has printed warnings
@@ -299,17 +300,17 @@ private slots:
void QLoggingCategory_installFilter()
{
- QVERIFY(QLoggingCategory::defaultCategory().isEnabled<QtDebugMsg>());
+ QVERIFY(QLoggingCategory::defaultCategory().isDebugEnabled());
QLoggingCategory::CategoryFilter defaultFilter =
QLoggingCategory::installFilter(customCategoryFilter);
QVERIFY(defaultFilter);
customCategoryFilterArgs.clear();
- QVERIFY(!QLoggingCategory::defaultCategory().isEnabled<QtDebugMsg>());
+ QVERIFY(!QLoggingCategory::defaultCategory().isDebugEnabled());
QLoggingCategory cat("custom");
QCOMPARE(customCategoryFilterArgs, QStringList() << "custom");
- QVERIFY(cat.isEnabled<QtDebugMsg>());
+ QVERIFY(cat.isDebugEnabled());
customCategoryFilterArgs.clear();
// install default filter
@@ -318,8 +319,8 @@ private slots:
QCOMPARE((void*)currentFilter, (void*)customCategoryFilter);
QCOMPARE(customCategoryFilterArgs.size(), 0);
- QVERIFY(QLoggingCategory::defaultCategory().isEnabled<QtDebugMsg>());
- QVERIFY(!cat.isEnabled<QtDebugMsg>());
+ QVERIFY(QLoggingCategory::defaultCategory().isDebugEnabled());
+ QVERIFY(!cat.isDebugEnabled());
// install default filter
currentFilter =
@@ -327,8 +328,8 @@ private slots:
QCOMPARE((void*)defaultFilter, (void*)currentFilter);
QCOMPARE(customCategoryFilterArgs.size(), 0);
- QVERIFY(QLoggingCategory::defaultCategory().isEnabled<QtDebugMsg>());
- QVERIFY(!cat.isEnabled<QtDebugMsg>());
+ QVERIFY(QLoggingCategory::defaultCategory().isDebugEnabled());
+ QVERIFY(!cat.isDebugEnabled());
}
void qDebugMacros()
@@ -732,6 +733,7 @@ private slots:
qCCritical(mycategoryobject) << "My Category Object";
QCOMPARE(cleanLogLine(logMessage), cleanLogLine(buf));
}
+ Q_UNUSED(pcategorybject);
}
void checkEmptyCategoryName()