Commit 47acb537 authored by Laurent Montel's avatar Laurent Montel

Add debug method. Fix autotest

parent 7ec9f02c
[Rules]
org.kde.kio.kpasswdserver.info=false
org.kde.kio.kpasswdserver.warning=true
org.kde.kio.kpasswdserver.debug=false
org.kde.kio.kpasswdserver.critical=true
......@@ -30,7 +30,7 @@ QTEST_GUILESS_MAIN(SaveRulesJobTest)
void compareFile(const QString &name)
{
const QString refFile = QLatin1String(KDEBUGSETTINGS_DATA_DIR) + QLatin1Char('/') + name + QStringLiteral(".ini");
const QString refFile = QLatin1String(KDEBUGSETTINGS_DATA_DIR) + QLatin1Char('/') + name + QStringLiteral(".ref");
const QString generatedFile = QLatin1String(KDEBUGSETTINGS_DATA_DIR) + QLatin1Char('/') + name + QStringLiteral("-generated.ref");
// compare to reference file
......@@ -55,19 +55,20 @@ SaveRulesJobTest::SaveRulesJobTest(QObject *parent)
void SaveRulesJobTest::shouldSaveLoadRules_data()
{
QTest::addColumn<QString>("filename");
QTest::newRow("oneelementall.ini") << QStringLiteral("oneelementall");
QTest::newRow("oneelementwarning.ini") << QStringLiteral("oneelementwarning");
}
void SaveRulesJobTest::shouldSaveLoadRules()
{
QFETCH(QString, filename);
LoadCategoriesJob job;
job.setFileName(filename);
job.setFileName(QLatin1String(KDEBUGSETTINGS_DATA_DIR) + QLatin1Char('/') + filename + QStringLiteral(".ini"));
job.start();
LoggingCategory::List customCategories = job.customCategories();
const LoggingCategory::List customCategories = job.customCategories();
const LoggingCategory::List qtKdeCategories = job.qtKdeCategories();
LoggingCategory::List qtKdeCategories = job.qtKdeCategories();
SaveRulesJob saveJob;
saveJob.setFileName(QLatin1String(KDEBUGSETTINGS_DATA_DIR) + QLatin1Char('/') + filename + QStringLiteral("-generated.ref"));
......
......@@ -123,3 +123,12 @@ QString LoggingCategory::createRule() const
}
return str;
}
QDebug operator<<(QDebug d, const LoggingCategory &cat)
{
d << "customcategories cat." << cat.description;
d << " logname" << cat.logName;
d << " enabled " << cat.enabled;
d << "type " << cat.loggingType;
return d;
}
......@@ -23,6 +23,7 @@
#include <QVector>
#include <QObject>
#include <QString>
#include <QDebug>
struct LoggingCategory {
enum LoggingType {
......@@ -54,6 +55,8 @@ struct LoggingCategory {
bool enabled;
};
QDebug operator<<(QDebug debug, const LoggingCategory &cat);
Q_DECLARE_TYPEINFO(LoggingCategory, Q_MOVABLE_TYPE);
Q_DECLARE_METATYPE(LoggingCategory)
Q_DECLARE_METATYPE(LoggingCategory::LoggingType)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment