Added more tests for the PacakageMetadata.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=732162
This commit is contained in:
parent
10802b7bd0
commit
666bfa93bd
@ -59,6 +59,12 @@ void PackageMetadataTest::removeDir(const QString &subdir)
|
||||
local.rmpath(subd);
|
||||
}
|
||||
|
||||
void PackageMetadataTest::screenshot()
|
||||
{
|
||||
// Defealt value
|
||||
QCOMPARE(pm->screenshot(), QString("screenshot.png"));
|
||||
}
|
||||
|
||||
void PackageMetadataTest::read()
|
||||
{
|
||||
pm->read("packagemetadatatest.desktop");
|
||||
@ -76,9 +82,9 @@ void PackageMetadataTest::read()
|
||||
QCOMPARE(pm->mainFile(), QString("Main file"));
|
||||
QCOMPARE(pm->application(), QString("A Test name"));
|
||||
QCOMPARE(pm->requiredVersion(), QString("1.2.3"));
|
||||
//QCOMPARE(pm->releaseNotes(), QString("Package metadata test file"));
|
||||
//QCOMPARE(pm->filenameToSave(), QString("Package metadata test file"));
|
||||
QCOMPARE(pm->icon(), QString("test"));
|
||||
QCOMPARE(pm->screenshot(), QString("a_not_default_file.svg"));
|
||||
QCOMPARE(pm->type(), QString("System test"));
|
||||
}
|
||||
|
||||
void PackageMetadataTest::write()
|
||||
@ -94,8 +100,6 @@ void PackageMetadataTest::write()
|
||||
pm->setMainFile(QString("Main file"));
|
||||
pm->setApplication(QString("A Test name"));
|
||||
pm->setRequiredVersion(QString("1.2.3"));
|
||||
//QCOMPARE(pm->releaseNotes(), QString("Package metadata test file"));
|
||||
//QCOMPARE(pm->filenameToSave(), QString("Package metadata test file"));
|
||||
pm->setIcon(QString("test"));
|
||||
|
||||
pm->write("somefile.desktop");
|
||||
@ -114,9 +118,21 @@ void PackageMetadataTest::write()
|
||||
QCOMPARE(pm->mainFile(), QString("Main file"));
|
||||
QCOMPARE(pm->application(), QString("A Test name"));
|
||||
QCOMPARE(pm->requiredVersion(), QString("1.2.3"));
|
||||
//QCOMPARE(pm->releaseNotes(), QString("Package metadata test file"));
|
||||
//QCOMPARE(pm->filenameToSave(), QString("Package metadata test file"));
|
||||
QCOMPARE(pm->icon(), QString("test"));
|
||||
}
|
||||
|
||||
void PackageMetadataTest::preview()
|
||||
{
|
||||
QCOMPARE(pm->preview(), QString());
|
||||
pm->setPreview("Test");
|
||||
QCOMPARE(pm->preview(), QString("Test"));
|
||||
}
|
||||
|
||||
void PackageMetadataTest::releaseNotes()
|
||||
{
|
||||
QCOMPARE(pm->releaseNotes(), QString());
|
||||
pm->setReleaseNotes("Test");
|
||||
QCOMPARE(pm->releaseNotes(), QString("Test"));
|
||||
}
|
||||
|
||||
QTEST_KDEMAIN(PackageMetadataTest, NoGUI)
|
||||
|
@ -8,6 +8,7 @@ ServiceTypes=Plasma/Applet
|
||||
|
||||
Description=Some fancy test description
|
||||
|
||||
X-KDE-Screenshot=a_not_default_file.svg
|
||||
X-KDE-Library=some_test_library
|
||||
X-KDE-PluginInfo-Author=Bertjan Broeksema
|
||||
X-KDE-PluginInfo-Email=b.broeksema@kdemail.net
|
||||
|
@ -32,8 +32,11 @@ public Q_SLOTS:
|
||||
void cleanup();
|
||||
|
||||
private Q_SLOTS:
|
||||
void screenshot();
|
||||
void read();
|
||||
void write();
|
||||
void preview();
|
||||
void releaseNotes();
|
||||
|
||||
private:
|
||||
void removeDir(const QString &subdir);
|
||||
|
Loading…
Reference in New Issue
Block a user