test passes now

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=824841
This commit is contained in:
Aaron J. Seigo 2008-06-26 17:59:49 +00:00
parent 41d8ae9752
commit 3bd5f495e0
2 changed files with 16 additions and 61 deletions

View File

@ -25,24 +25,20 @@
void PackageMetadataTest::init()
{
pm = new Plasma::PackageMetadata;
// Create data dir
mDataDir = QDir::homePath() + "/.kde-unit-test/share/config";
mDataDir = QDir::homePath() + "/.kde-unit-test/share/config/";
QVERIFY(QDir().mkpath(mDataDir));
QDir dir(mDataDir);
QFile::copy(QString::fromLatin1(KDESRCDIR)
+ QLatin1String("/packagemetadatatest.desktop"), mDataDir
+ QLatin1String("/packagemetadatatest.desktop"));
+ QLatin1String("packagemetadatatest.desktop"), mDataDir
+ QLatin1String("packagemetadatatest.desktop"));
}
void PackageMetadataTest::cleanup()
{
delete pm;
// Clean things up.
removeDir(QLatin1String("share/config"));
QDir().rmpath(QDir::homePath() + "/.kde-unit-test/share");
}
// Copied from ktimezonetest.h
@ -65,8 +61,8 @@ void PackageMetadataTest::read()
QVERIFY(pm->isValid());
QCOMPARE(pm->name(), QString("test"));
QCOMPARE(pm->description(), QString("Some fancy test description"));
QCOMPARE(pm->name(), QString("Package metadata test file"));
QCOMPARE(pm->description(), QString("A test desktop file to test the PackageMetaData class."));
QCOMPARE(pm->serviceType(), QString("Plasma/Applet"));
QCOMPARE(pm->author(), QString("Bertjan Broeksema"));
QCOMPARE(pm->email(), QString("b.broeksema@kdemail.net"));
@ -80,8 +76,8 @@ void PackageMetadataTest::read()
void PackageMetadataTest::write()
{
pm->setName(QString("Package metadata test file"));
pm->setDescription(QString("Some fancy test description"));
pm->setName(QString("Package metadata test file copy"));
pm->setDescription(QString("Some other fancy test description"));
pm->setServiceType(QString("Plasma/Applet"));
pm->setAuthor(QString("Bertjan Broeksema"));
pm->setEmail(QString("b.broeksema@kdemail.net"));
@ -90,14 +86,14 @@ void PackageMetadataTest::write()
pm->setLicense(QString("GPL"));
pm->setApplication(QString("A Test name"));
pm->setRequiredVersion(QString("1.2.3"));
pm->write("somefile.desktop");
pm->write(mDataDir + "somefile.desktop");
delete pm;
pm = new Plasma::PackageMetadata("somefile.desktop");
QCOMPARE(pm->name(), QString("Package metadata test file"));
QCOMPARE(pm->description(), QString("Some fancy test description"));
pm = new Plasma::PackageMetadata(mDataDir + "somefile.desktop");
QCOMPARE(pm->name(), QString("Package metadata test file copy"));
QCOMPARE(pm->description(), QString("Some other fancy test description"));
QCOMPARE(pm->serviceType(), QString("Plasma/Applet"));
QCOMPARE(pm->author(), QString("Bertjan Broeksema"));
QCOMPARE(pm->email(), QString("b.broeksema@kdemail.net"));

View File

@ -85,47 +85,6 @@ Icon=test
Type=Service
X-KDE-ServiceTypes=Plasma/Applet
Description=Some fancy test description
Description[ca]=Alguna descripció de proves imaginativa
Description[da]=En eller anden fin testbeskrivelse
Description[de]=Eine lustige Test-Beschreibung
Description[el]=Μια δοκιμαστική περιγραφή
Description[eo]=Komplika testa priskribo
Description[es]=Algunas descripciones adornadas de prueba
Description[et]=Vahva testikirjeldus
Description[fi]=Joku metka testikuvaus
Description[fr]=Une description fantaisiste pour le test
Description[fy]=In elegante testomskriuwing
Description[ga]=Cur síos ar thástáil chasta
Description[gl]=Unha descrición de proba
Description[gu]=
Description[hu]=Tesztleírás
Description[is]=Einhver krassandi lýsing til prufu
Description[it]=Una descrizione fantasiosa del test
Description[km]=
Description[ko]=
Description[lv]=Skaists teksta apraksts
Description[nb]=En flott testbeskrivelse
Description[nds]=Jichtenseen smuck Testbeschrieven
Description[nl]=Een elegante testbeschrijving
Description[nn]=Ei flott testskildring
Description[pa]=
Description[pl]=Jakiś opis testowy
Description[pt]=Uma descrição de teste bonita
Description[pt_BR]=Alguma descrição de teste interessante
Description[ro]=O descriere de test chichi
Description[se]=Somás geahččalanválddahus
Description[sl]=Zanimiv preizkusni opis
Description[sr]=Некакав звучан опис пробе
Description[sr@latin]=Nekakav zvučan opis probe
Description[sv]=Någon utstuderad testbeskrivning
Description[th]=
Description[tr]=Bazı eğlenceli test tanımlamaları
Description[uk]=Якийсь опис для тесту
Description[x-test]=xxSome fancy test descriptionxx
Description[zh_CN]=
Description[zh_TW]=
X-KDE-Screenshot=a_not_default_file.svg
X-KDE-Library=some_test_library
X-KDE-PluginInfo-Author=Bertjan Broeksema