summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-29 05:26:36 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-29 05:26:36 (GMT)
commit883c9977a64867c26a42c38d1050953a2ea68de0 (patch)
treeed9c8468b0cb01be2ef014324c964fab05976c70
parent104ec1b770106e67842448f8a3e2642f715b09fb (diff)
Add more autotest
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.cpp12
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.h1
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp12
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h1
4 files changed, 26 insertions, 0 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.cpp b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.cpp
index 5ec724e..067190a 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.cpp
@@ -55,4 +55,16 @@ void ViewerPluginExternalEditWidgetTest::shouldHaveDefaultValue()
QVERIFY(mExecutable);
}
+void ViewerPluginExternalEditWidgetTest::shouldGetSaveInfo()
+{
+ ViewerPluginExternalEditWidget w;
+ ViewerPluginExternalScriptInfo info;
+ info.setCommandLine(QStringLiteral("foo"));
+ info.setDescription(QStringLiteral("blo"));
+ info.setExecutable(QStringLiteral("voo"));
+ info.setName(QStringLiteral("bla"));
+ w.setScriptInfo(info);
+ QCOMPARE(info, w.scriptInfo());
+}
+
QTEST_MAIN(ViewerPluginExternalEditWidgetTest)
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.h b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.h
index f9141db..568e4ee 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternaleditwidgettest.h
@@ -30,6 +30,7 @@ public:
~ViewerPluginExternalEditWidgetTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
+ void shouldGetSaveInfo();
};
#endif // VIEWERPLUGINEXTERNALEDITWIDGETTEST_H
diff --git a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp
index 9c793c4..823680c 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.cpp
@@ -100,3 +100,15 @@ void ViewerPluginExternalScriptInfo::setFileName(const QString &fileName)
{
mFileName = fileName;
}
+
+bool ViewerPluginExternalScriptInfo::operator==(const ViewerPluginExternalScriptInfo &other) const
+{
+ return (name() == other.name()) &&
+ (commandLine() == other.commandLine()) &&
+ (executable() == other.executable()) &&
+ (description() == other.description()) &&
+ (icon() == other.icon()) &&
+ (isReadOnly() == other.isReadOnly()) &&
+ (fileName() == other.fileName());
+
+}
diff --git a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h
index ba61c5d..02009cf 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinfo.h
@@ -49,6 +49,7 @@ public:
QString fileName() const;
void setFileName(const QString &fileName);
+ bool operator==(const ViewerPluginExternalScriptInfo &other) const;
private:
QString mCommandLine;
QString mName;