summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-19 11:29:07 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-19 11:29:07 (GMT)
commit8be2e4d05cd5fd56d5edd5f340e268d0d31cf5b6 (patch)
tree6644b114554d3fda26e7a56cc841c9453ffb41dd
parent021fb855d978dd2f8459acaef2665bcda6cc5a4f (diff)
Add more autotest
-rw-r--r--autotests/kdebugsettingutiltest.cpp20
-rw-r--r--autotests/kdebugsettingutiltest.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/autotests/kdebugsettingutiltest.cpp b/autotests/kdebugsettingutiltest.cpp
index 4fa89dc..1adbf3a 100644
--- a/autotests/kdebugsettingutiltest.cpp
+++ b/autotests/kdebugsettingutiltest.cpp
@@ -126,4 +126,24 @@ void KDebugSettingUtilTest::shouldReadLoadKdeCategories()
QCOMPARE(lst.count(), numberofcategories);
}
+void KDebugSettingUtilTest::shouldReadRenameCategories_data()
+{
+ QTest::addColumn<QString>("filename");
+ QTest::addColumn<int>("numberofrenamecategories");
+ QTest::newRow("empty") << QStringLiteral("empty.renamecategories") << 0;
+ QTest::newRow("2renamed") << QStringLiteral("tworename.renamecategories") << 2;
+ QTest::newRow("withnewline") << QStringLiteral("newline.renamecategories") << 2;
+}
+
+void KDebugSettingUtilTest::shouldReadRenameCategories()
+{
+ QFETCH(QString, filename);
+ QFETCH(int, numberofrenamecategories);
+ const QString path = QString(QLatin1String(KDEBUGSETTINGS_DATA_DIR) + QLatin1Char('/') + filename);
+ QFile file(path);
+ QVERIFY(file.exists());
+ const RenameCategory::List lst = KDebugSettingsUtil::readRenameCategories(path);
+ QCOMPARE(lst.count(), numberofrenamecategories);
+}
+
QTEST_GUILESS_MAIN(KDebugSettingUtilTest)
diff --git a/autotests/kdebugsettingutiltest.h b/autotests/kdebugsettingutiltest.h
index 00175eb..d171362 100644
--- a/autotests/kdebugsettingutiltest.h
+++ b/autotests/kdebugsettingutiltest.h
@@ -39,6 +39,9 @@ private Q_SLOTS:
void shouldReadLoadKdeCategories_data();
void shouldReadLoadKdeCategories();
+ void shouldReadRenameCategories_data();
+ void shouldReadRenameCategories();
+
};
#endif // KDEBUGSETTINGUTILTEST_H