fix packagestructure test

This commit is contained in:
Aaron Seigo 2013-02-15 15:16:54 +01:00
parent 7cabcaa9ac
commit aea5627ef4
3 changed files with 6 additions and 11 deletions

View File

@ -373,7 +373,6 @@ QStringList Package::entryList(const char *key) const
void Package::setPath(const QString &path)
{
kDebug() << "Package::setPath() " << path;
// if the path is already what we have, don't bother
if (path == d->path) {
return;

View File

@ -43,10 +43,10 @@ public:
};
PackageStructureTest::PackageStructureTest()
void PackageStructureTest::initTestCase()
{
m_packagePath = QString::fromLatin1(KDESRCDIR) + "signedPackage/";
ps = Plasma::PluginLoader::self()->loadPackage("Plasma/Applet");
m_packagePath = QString::fromLatin1(KDESRCDIR) + "testpackage";
ps = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
ps.setPath(m_packagePath);
}
@ -155,10 +155,8 @@ void PackageStructureTest::requiredFiles()
void PackageStructureTest::path()
{
qDebug() << "real paths are" << ps.filePath("images") << ps.filePath("mainscript");
qDebug() << "we wants" << QString(m_packagePath + QString("contents/images")) << QString(m_packagePath + QString("contents/code/main.js"));
QCOMPARE(ps.filePath("images"), QFileInfo(m_packagePath + QString("contents/images")).canonicalFilePath());
QCOMPARE(ps.filePath("mainscript"), QFileInfo(m_packagePath + QString("contents/code/main.js")).canonicalFilePath());
QCOMPARE(ps.filePath("images"), QDir(m_packagePath + QString("/contents/images")).canonicalPath());
QCOMPARE(ps.filePath("mainscript"), QFileInfo(m_packagePath + QString("/contents/ui/main.qml")).canonicalFilePath());
}
void PackageStructureTest::name()

View File

@ -27,10 +27,8 @@ class PackageStructureTest : public QObject
{
Q_OBJECT
public:
PackageStructureTest();
private Q_SLOTS:
void initTestCase();
void copyPerformance();
void emptyContentsPrefix();
void multiplePaths();