diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2014-10-06 15:03:54 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2014-10-06 15:03:54 +0200 |
| commit | 529f38bd8878b6b1bea2b5457031ce936aab8d80 (patch) | |
| tree | 1193caefcad12f6a36f818048e4547e60add4398 /libcommuni/tests/benchmarks/irctextformat/tst_irctextformat.cpp | |
| parent | 3b58b5536935adff242928ed9f30e1c0262fbd7c (diff) | |
| download | manager-529f38bd8878b6b1bea2b5457031ce936aab8d80.tar.gz manager-529f38bd8878b6b1bea2b5457031ce936aab8d80.zip | |
addedd communi
Diffstat (limited to 'libcommuni/tests/benchmarks/irctextformat/tst_irctextformat.cpp')
| -rw-r--r-- | libcommuni/tests/benchmarks/irctextformat/tst_irctextformat.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libcommuni/tests/benchmarks/irctextformat/tst_irctextformat.cpp b/libcommuni/tests/benchmarks/irctextformat/tst_irctextformat.cpp new file mode 100644 index 0000000..1da9483 --- /dev/null +++ b/libcommuni/tests/benchmarks/irctextformat/tst_irctextformat.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008-2014 The Communi Project + * + * This test is free, and not covered by the BSD license. There is no + * restriction applied to their modification, redistribution, using and so on. + * You can study them, modify them, use them in your own program - either + * completely or partially. + */ + +#include "irctextformat.h" +#include <QtTest/QtTest> + +class tst_IrcTextFormat : public QObject +{ + Q_OBJECT + +private slots: + void testToHtml_data(); + void testToHtml(); +}; + +void tst_IrcTextFormat::testToHtml_data() +{ + QTest::addColumn<QString>("text"); + + QTest::newRow("info") << QString("[freenode-info] if you're at a conference and other people are having trouble connecting, please mention it to staff: http://freenode.net/faq.shtml#gettinghelp"); + QTest::newRow("topic") << QString("Communi 1.2.2 - IRC framework || Home: http://communi.github.com || Docs: http://communi.github.com/doc || MeeGo: http://store.ovi.com/content/219150"); + QTest::newRow("commit") << QString("[communi-desktop] jpnurmi pushed 2 new commits to master: https://github.com/communi/communi-desktop/compare/257ca915a490...8832bfe8d0b8"); + QTest::newRow("welcome") << QString("Welcome to the Communi development lounge. Communi for MeeGo/Symbian users are kindly asked to submit a review in Nokia Store."); +} + +void tst_IrcTextFormat::testToHtml() +{ + QFETCH(QString, text); + + IrcTextFormat format; + QBENCHMARK { + format.toHtml(text); + } +} + +QTEST_MAIN(tst_IrcTextFormat) + +#include "tst_irctextformat.moc" |
