[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:22:41 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=b3aa746
The following commit has been merged in the master branch:
commit b3aa7469a36419dd99425489b900c530befbaad9
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Tue Aug 28 12:48:39 2012 +0200
[tests] Make compare and compareWithPlainText macros
This allows to get the line number of the failing tests
---
tests/message-processor-basic-tests.cpp | 44 ++++++++++++++++-----------------
tests/message-processor-basic-tests.h | 4 ---
2 files changed, 21 insertions(+), 27 deletions(-)
diff --git a/tests/message-processor-basic-tests.cpp b/tests/message-processor-basic-tests.cpp
index b981211..06ab841 100644
--- a/tests/message-processor-basic-tests.cpp
+++ b/tests/message-processor-basic-tests.cpp
@@ -20,6 +20,27 @@
#include <KUrl>
#include <QTextDocument>
+
+#define compare(input, expected) \
+{ \
+ QString processed = s.getProcessedMessage(input); \
+ QString href = QLatin1String(expected); \
+ QCOMPARE(processed, href); \
+}
+
+#define compareWithPlainText(input, expected) \
+{ \
+ QString processed = s.getProcessedMessage(input); \
+ QString href = QLatin1String(expected); \
+ QCOMPARE(processed, href); \
+ QTextDocument inputdoc, processeddoc; \
+ inputdoc.setHtml(QLatin1String(input)); \
+ processeddoc.setHtml(href); \
+ QString processedtext = processeddoc.toPlainText().replace(QLatin1String("\*"), QLatin1String("*")); \
+ QCOMPARE(inputdoc.toPlainText(), processedtext); \
+}
+
+
Tp::Message normalMessage(const char* msg) {
return Tp::Message(Tp::ChannelTextMessageTypeNormal, QLatin1String(msg));
}
@@ -101,29 +122,6 @@ void MessageProcessorBasicTests::testMultipleURLCatching()
QCOMPARE(qvariant_cast<KUrl>(urls.at(1)), KUrl("http://www.google.com.au"));
}
-void MessageProcessorBasicTests::compare(const char *input, const char *expected)
-{
- QString processed = s.getProcessedMessage(input);
- QString href = QLatin1String(expected);
-
- QCOMPARE(processed, href);
-}
-
-void MessageProcessorBasicTests::compareWithPlainText(const char *input, const char *expected)
-{
- QString processed = s.getProcessedMessage(input);
- QString href = QLatin1String(expected);
-
- QCOMPARE(processed, href);
-
- QTextDocument inputdoc, processeddoc;
- inputdoc.setHtml(QLatin1String(input));
- processeddoc.setHtml(href);
- QString processedtext = processeddoc.toPlainText().replace(QLatin1String("\*"), QLatin1String("*"));
-
- QCOMPARE(inputdoc.toPlainText(), processedtext);
-}
-
void MessageProcessorBasicTests::testImageEmbedGIF()
{
const char* message = "http://kde.org/images/teaser/jointhegame.gif";
diff --git a/tests/message-processor-basic-tests.h b/tests/message-processor-basic-tests.h
index 2de3c28..dd02c9b 100644
--- a/tests/message-processor-basic-tests.h
+++ b/tests/message-processor-basic-tests.h
@@ -27,10 +27,6 @@ class MessageProcessorBasicTests : public QObject
{
Q_OBJECT
-private:
- void compare (const char* input, const char* expected);
- void compareWithPlainText (const char* input, const char* expected);
-
SyncProcessor s;
private Q_SLOTS:
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list