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) void Package::setPath(const QString &path)
{ {
kDebug() << "Package::setPath() " << path;
// if the path is already what we have, don't bother // if the path is already what we have, don't bother
if (path == d->path) { if (path == d->path) {
return; return;

View File

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

View File

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