[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdepim] messageviewer/src/viewerplugins/autotests: Add more autotests
From: Montel Laurent <montel () kde ! org>
Date: 2015-09-30 19:06:14
Message-ID: E1ZhMhi-0001F5-8O () scm ! kde ! org
[Download RAW message or body]
Git commit 7ed58074f1f346d725d522ec2f15dd57638b9c4c by Montel Laurent.
Committed on 30/09/2015 at 19:05.
Pushed by mlaurent into branch 'master'.
Add more autotests
M +2 -0 messageviewer/src/viewerplugins/autotests/CMakeLists.txt
M +2 -1 messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
C +6 -6 messageviewer/src/viewerplugins/autotests/viewerplugintoolmanagertest.cpp [from: \
messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp - 071% similarity] C +13 -18 \
messageviewer/src/viewerplugins/autotests/viewerplugintoolmanagertest.h [from: \
messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp - 065% similarity] A +59 -0 \
messageviewer/src/viewerplugins/autotests/viewerplugintranslatortest.cpp [License: GPL (v2)] C +13 \
-16 messageviewer/src/viewerplugins/autotests/viewerplugintranslatortest.h [from: \
messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp - 064% similarity]
http://commits.kde.org/kdepim/7ed58074f1f346d725d522ec2f15dd57638b9c4c
diff --git a/messageviewer/src/viewerplugins/autotests/CMakeLists.txt \
b/messageviewer/src/viewerplugins/autotests/CMakeLists.txt index b480561..b2ed280 100644
--- a/messageviewer/src/viewerplugins/autotests/CMakeLists.txt
+++ b/messageviewer/src/viewerplugins/autotests/CMakeLists.txt
@@ -22,6 +22,8 @@ macro(add_messageviewer_viewerplugin_class_unittest _source )
endmacro ()
add_messageviewer_viewerplugin_class_unittest(viewerpluginmanagertest.cpp)
+add_messageviewer_viewerplugin_class_unittest(viewerplugintoolmanagertest.cpp)
add_messageviewer_viewerplugin_unittest(viewerplugincreateeventtest.cpp \
"../createeventplugin/viewerplugincreateevent.cpp;../createeventplugin/viewerplugincreateeventinterface.cpp" \
"../createeventplugin/messageviewer_createeventplugin.desktop") \
add_messageviewer_viewerplugin_unittest(viewerplugincreatetodotest.cpp \
"../createtodoplugin/viewerplugincreatetodo.cpp;../createtodoplugin/viewerplugincreatetodointerface.cpp" \
"../createtodoplugin/messageviewer_createtodoplugin.desktop") \
add_messageviewer_viewerplugin_unittest(viewerplugincreatenotetest.cpp \
"../createnoteplugin/viewerplugincreatenote.cpp;../createnoteplugin/viewerplugincreatenoteinterface.cpp" \
"../createnoteplugin/messageviewer_createnoteplugin.desktop") \
+add_messageviewer_viewerplugin_unittest(viewerplugintranslatortest.cpp \
"../translatorplugin/viewerplugintranslator.cpp;../translatorplugin/viewerplugintranslatorinterface.cpp" \
"../translatorplugin/messageviewer_translatorplugin.desktop")
diff --git a/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp \
b/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp index e7b5e21..3898e5b 100644
--- a/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
+++ b/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
@@ -32,7 +32,8 @@ ViewerPluginManagerTest::~ViewerPluginManagerTest()
void ViewerPluginManagerTest::shouldHaveDefaultValue()
{
- //TODO
+ MessageViewer::ViewerPluginManager *manager = new MessageViewer::ViewerPluginManager(this);
+ QVERIFY(!manager->pluginsList().isEmpty());
}
QTEST_MAIN(ViewerPluginManagerTest)
diff --git a/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp \
b/messageviewer/src/viewerplugins/autotests/viewerplugintoolmanagertest.cpp similarity index 71%
copy from messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
copy to messageviewer/src/viewerplugins/autotests/viewerplugintoolmanagertest.cpp
index e7b5e21..e5204ab 100644
--- a/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
+++ b/messageviewer/src/viewerplugins/autotests/viewerplugintoolmanagertest.cpp
@@ -15,24 +15,24 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "viewerpluginmanagertest.h"
-#include "../viewerpluginmanager.h"
+#include "viewerplugintoolmanagertest.h"
+#include "../viewerplugintoolmanager.h"
#include <QTest>
-ViewerPluginManagerTest::ViewerPluginManagerTest(QObject *parent)
+ViewerPluginToolManagerTest::ViewerPluginToolManagerTest(QObject *parent)
: QObject(parent)
{
}
-ViewerPluginManagerTest::~ViewerPluginManagerTest()
+ViewerPluginToolManagerTest::~ViewerPluginToolManagerTest()
{
}
-void ViewerPluginManagerTest::shouldHaveDefaultValue()
+void ViewerPluginToolManagerTest::shouldHaveDefaultValue()
{
//TODO
}
-QTEST_MAIN(ViewerPluginManagerTest)
+QTEST_MAIN(ViewerPluginToolManagerTest)
diff --git a/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp \
b/messageviewer/src/viewerplugins/autotests/viewerplugintoolmanagertest.h similarity index 65%
copy from messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
copy to messageviewer/src/viewerplugins/autotests/viewerplugintoolmanagertest.h
index e7b5e21..ddb29a9 100644
--- a/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
+++ b/messageviewer/src/viewerplugins/autotests/viewerplugintoolmanagertest.h
@@ -15,24 +15,19 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "viewerpluginmanagertest.h"
-#include "../viewerpluginmanager.h"
-#include <QTest>
+#ifndef VIEWERPLUGINTOOLMANAGERTEST_H
+#define VIEWERPLUGINTOOLMANAGERTEST_H
-ViewerPluginManagerTest::ViewerPluginManagerTest(QObject *parent)
- : QObject(parent)
-{
-
-}
-
-ViewerPluginManagerTest::~ViewerPluginManagerTest()
-{
-
-}
+#include <QObject>
-void ViewerPluginManagerTest::shouldHaveDefaultValue()
+class ViewerPluginToolManagerTest : public QObject
{
- //TODO
-}
-
-QTEST_MAIN(ViewerPluginManagerTest)
+ Q_OBJECT
+public:
+ explicit ViewerPluginToolManagerTest(QObject *parent = Q_NULLPTR);
+ ~ViewerPluginToolManagerTest();
+private Q_SLOTS:
+ void shouldHaveDefaultValue();
+};
+
+#endif // VIEWERPLUGINTOOLMANAGERTEST_H
diff --git a/messageviewer/src/viewerplugins/autotests/viewerplugintranslatortest.cpp \
b/messageviewer/src/viewerplugins/autotests/viewerplugintranslatortest.cpp new file mode 100644
index 0000000..b81299d
--- /dev/null
+++ b/messageviewer/src/viewerplugins/autotests/viewerplugintranslatortest.cpp
@@ -0,0 +1,59 @@
+/*
+ Copyright (c) 2015 Montel Laurent <montel@kde.org>
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License, version 2, as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "viewerplugintranslatortest.h"
+#include "../translatorplugin/viewerplugintranslator.h"
+#include <QTest>
+#include <KActionCollection>
+#include <QHBoxLayout>
+#include <viewerplugins/viewerplugininterface.h>
+
+ViewerPluginTranslatorTest::ViewerPluginTranslatorTest(QObject *parent)
+ : QObject(parent)
+{
+
+}
+
+ViewerPluginTranslatorTest::~ViewerPluginTranslatorTest()
+{
+
+}
+
+void ViewerPluginTranslatorTest::shouldHaveDefaultValue()
+{
+ MessageViewer::ViewerPluginTranslator *translator = new MessageViewer::ViewerPluginTranslator(this);
+ QVERIFY(!translator->viewerPluginName().isEmpty());
+ QWidget *parent = new QWidget(0);
+ parent->setLayout(new QHBoxLayout);
+
+ QVERIFY(translator->createView(parent, new KActionCollection(this)));
+
+}
+
+
+void ViewerPluginTranslatorTest::shouldCreateAction()
+{
+ MessageViewer::ViewerPluginTranslator *translator = new MessageViewer::ViewerPluginTranslator(this);
+ QVERIFY(!translator->viewerPluginName().isEmpty());
+ QWidget *parent = new QWidget(0);
+ parent->setLayout(new QHBoxLayout);
+
+ MessageViewer::ViewerPluginInterface *interface = translator->createView(parent, new \
KActionCollection(this)); + QVERIFY(interface->action());
+}
+
+QTEST_MAIN(ViewerPluginTranslatorTest)
diff --git a/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp \
b/messageviewer/src/viewerplugins/autotests/viewerplugintranslatortest.h similarity index 64%
copy from messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
copy to messageviewer/src/viewerplugins/autotests/viewerplugintranslatortest.h
index e7b5e21..5d21309 100644
--- a/messageviewer/src/viewerplugins/autotests/viewerpluginmanagertest.cpp
+++ b/messageviewer/src/viewerplugins/autotests/viewerplugintranslatortest.h
@@ -15,24 +15,21 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "viewerpluginmanagertest.h"
-#include "../viewerpluginmanager.h"
-#include <QTest>
+#ifndef VIEWERPLUGINTRANSLATORTEST_H
+#define VIEWERPLUGINTRANSLATORTEST_H
-ViewerPluginManagerTest::ViewerPluginManagerTest(QObject *parent)
- : QObject(parent)
-{
-
-}
+#include <QObject>
-ViewerPluginManagerTest::~ViewerPluginManagerTest()
+class ViewerPluginTranslatorTest : public QObject
{
+ Q_OBJECT
+public:
+ explicit ViewerPluginTranslatorTest(QObject *parent = Q_NULLPTR);
+ ~ViewerPluginTranslatorTest();
-}
-
-void ViewerPluginManagerTest::shouldHaveDefaultValue()
-{
- //TODO
-}
+private Q_SLOTS:
+ void shouldHaveDefaultValue();
+ void shouldCreateAction();
+};
-QTEST_MAIN(ViewerPluginManagerTest)
+#endif // VIEWERPLUGINTRANSLATORTEST_H
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic