tests for isValid and hasValidStructure

This commit is contained in:
Aaron Seigo 2014-08-08 14:12:09 +02:00
parent 928d5e63a5
commit b9405c5702
2 changed files with 24 additions and 0 deletions

View File

@ -49,6 +49,28 @@ void PackageStructureTest::initTestCase()
ps.setPath(m_packagePath);
}
void PackageStructureTest::validStructures()
{
QVERIFY(ps.hasValidStructure());
QVERIFY(!Plasma::Package().hasValidStructure());
QVERIFY(!Plasma::PluginLoader::self()->loadPackage("doesNotExist").hasValidStructure());
}
void PackageStructureTest::validPackages()
{
QVERIFY(ps.isValid());
QVERIFY(!Plasma::Package().isValid());
QVERIFY(!Plasma::PluginLoader::self()->loadPackage("doesNotExist").isValid());
QVERIFY(NoPrefixes().isValid());
Plasma::Package p = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
QVERIFY(!p.isValid());
p.setPath("/does/not/exist");
QVERIFY(!p.isValid());
p.setPath(ps.path());
QVERIFY(p.isValid());
}
void PackageStructureTest::copyPerformance()
{
// seed the cache first

View File

@ -29,6 +29,8 @@ class PackageStructureTest : public QObject
private Q_SLOTS:
void initTestCase();
void validStructures();
void validPackages();
void copyPerformance();
void mutateAfterCopy();
void emptyContentsPrefix();