Commit 883c9977 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more autotest

parent 104ec1b7
......@@ -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)
......@@ -30,6 +30,7 @@ public:
~ViewerPluginExternalEditWidgetTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldGetSaveInfo();
};
#endif // VIEWERPLUGINEXTERNALEDITWIDGETTEST_H
......@@ -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());
}
......@@ -49,6 +49,7 @@ public:
QString fileName() const;
void setFileName(const QString &fileName);
bool operator==(const ViewerPluginExternalScriptInfo &other) const;
private:
QString mCommandLine;
QString mName;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment