Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 3267f85e authored by Laurent Montel's avatar Laurent Montel 😁

Adapt autotest

parent 3dc8d25e
......@@ -39,23 +39,24 @@ void KDebugSettingUtilTest::shouldParseKdeLoggingLine_data()
QTest::addColumn<QString>("input");
QTest::addColumn<QString>("description");
QTest::addColumn<QString>("logname");
QTest::addColumn<QString>("defaultCategory");
QTest::addColumn<bool>("valid");
QTest::newRow("empty") << QString() << QString() << QString() << false;
QTest::newRow("validLine") << QStringLiteral("log linux") << QStringLiteral("linux") << QStringLiteral("log") << true;
QTest::newRow("validLinewithspace") << QStringLiteral(" log linux ") << QStringLiteral("linux") << QStringLiteral("log") << true;
QTest::newRow("comment") << QStringLiteral("#log linux ") << QString() << QString() << false;
QTest::newRow("commentWithSpace") << QStringLiteral(" #log linux ") << QString() << QString() << false;
QTest::newRow("badline") << QStringLiteral("log") << QString() << QString() << false;
QTest::newRow("comment-2") << QStringLiteral("#log linux") << QString() << QString() << false;
QTest::newRow("validLineWithParentheses") << QStringLiteral("log linux (foo)") << QStringLiteral("linux (foo)") << QStringLiteral("log") << true;
QTest::newRow("validLineWithParenthesesAndCategories") << QStringLiteral("log linux (foo) [WARNING]") << QStringLiteral("linux (foo)") << QStringLiteral("log") << true;
QTest::newRow("validLineCategories") << QStringLiteral("log linux [WARNING]") << QStringLiteral("linux") << QStringLiteral("log") << true;
QTest::newRow("validLineCategories2") << QStringLiteral("log linux [WARNING] ") << QStringLiteral("linux") << QStringLiteral("log") << true;
QTest::newRow("validLineCategories3") << QStringLiteral("log linux [WARNING] ") << QStringLiteral("linux") << QStringLiteral("log") << true;
QTest::newRow("linewithcomment") << QStringLiteral("log linux#comment about linux") << QStringLiteral("linux") << QStringLiteral("log") << true;
QTest::newRow("empty") << QString() << QString() << QString() << QString() << false;
QTest::newRow("validLine") << QStringLiteral("log linux") << QStringLiteral("linux") << QStringLiteral("log") << QString() << true;
QTest::newRow("validLinewithspace") << QStringLiteral(" log linux ") << QStringLiteral("linux") << QStringLiteral("log") << QString() << true;
QTest::newRow("comment") << QStringLiteral("#log linux ") << QString() << QString() << QString() << false;
QTest::newRow("commentWithSpace") << QStringLiteral(" #log linux ") << QString() << QString() << QString() << false;
QTest::newRow("badline") << QStringLiteral("log") << QString() << QString() << QString() << false;
QTest::newRow("comment-2") << QStringLiteral("#log linux") << QString() << QString() << QString() << false;
QTest::newRow("validLineWithParentheses") << QStringLiteral("log linux (foo)") << QStringLiteral("linux (foo)") << QStringLiteral("log") << QString() << true;
QTest::newRow("validLineWithParenthesesAndCategories") << QStringLiteral("log linux (foo) [WARNING]") << QStringLiteral("linux (foo)") << QStringLiteral("log") << QString() << true;
QTest::newRow("validLineCategories") << QStringLiteral("log linux [WARNING]") << QStringLiteral("linux") << QStringLiteral("log") << QString() << true;
QTest::newRow("validLineCategories2") << QStringLiteral("log linux [WARNING] ") << QStringLiteral("linux") << QStringLiteral("log") << QString() << true;
QTest::newRow("validLineCategories3") << QStringLiteral("log linux [WARNING] ") << QStringLiteral("linux") << QStringLiteral("log") << QString() << true;
QTest::newRow("linewithcomment") << QStringLiteral("log linux#comment about linux") << QStringLiteral("linux") << QStringLiteral("log") << QString() << true;
}
void KDebugSettingUtilTest::shouldParseKdeLoggingLine()
......@@ -63,6 +64,7 @@ void KDebugSettingUtilTest::shouldParseKdeLoggingLine()
QFETCH(QString, input);
QFETCH(QString, description);
QFETCH(QString, logname);
QFETCH(QString, defaultCategory);
QFETCH(bool, valid);
KdeLoggingCategory result;
result.description = description;
......
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