summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-29 05:36:49 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-29 05:36:49 (GMT)
commitd09190cf1e9ce70b13b9aa0ba7053c86c51ae0b9 (patch)
tree082ebaa35800104abb3020edaf25639083c2525b
parent5c0fe7c9e2f4475b7d6845acca8662e6b2327c93 (diff)
Add more autotests
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.cpp24
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.cpp b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.cpp
index 98f7600..9ade519 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.cpp
@@ -60,4 +60,28 @@ void ViewerPluginExternalScriptInfoTest::shouldHaveValid()
QVERIFY(!info.isValid());
}
+void ViewerPluginExternalScriptInfoTest::shouldBeEqual_data()
+{
+ QTest::addColumn<ViewerPluginExternalScriptInfo>("scriptinfo");
+ QTest::newRow("empty") << ViewerPluginExternalScriptInfo();
+
+ ViewerPluginExternalScriptInfo f;
+ f.setCommandLine(QStringLiteral("dd"));
+ f.setDescription(QStringLiteral("bla"));
+ f.setIsReadOnly(true);
+ QTest::newRow("not-empty-1") << f;
+ f.setExecutable(QStringLiteral("ssss"));
+ QTest::newRow("not-empty-2") << f;
+ f.setIcon(QStringLiteral("bloblo"));
+ QTest::newRow("not-empty-3") << f;
+}
+
+void ViewerPluginExternalScriptInfoTest::shouldBeEqual()
+{
+ QFETCH(ViewerPluginExternalScriptInfo, scriptinfo);
+ ViewerPluginExternalScriptInfo f;
+ f = scriptinfo;
+ QCOMPARE(f, scriptinfo);
+}
+
QTEST_MAIN(ViewerPluginExternalScriptInfoTest)
diff --git a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.h b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.h
index 2c5ba5a..bf0dd33 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.h
+++ b/plugins/messageviewerplugins/externalscriptplugin/autotests/viewerpluginexternalscriptinfotest.h
@@ -32,6 +32,8 @@ public:
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldHaveValid();
+ void shouldBeEqual_data();
+ void shouldBeEqual();
};
#endif // VIEWERPLUGINEXTERNALSCRIPTINFOTEST_H