more verbose name

This commit is contained in:
Marco Martin 2014-09-01 20:36:06 +02:00
parent 6be2e9d46d
commit 04593a3f1b
2 changed files with 13 additions and 13 deletions

View File

@ -29,8 +29,8 @@
void FallbackPackageTest::initTestCase() void FallbackPackageTest::initTestCase()
{ {
m_fallPackagePath = QFINDTESTDATA("data/testpackage"); m_fallPackagePath = QFINDTESTDATA("data/testpackage");
m_fallPkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic"); m_fallbackPkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
m_fallPkg.setPath(m_fallPackagePath); m_fallbackPkg.setPath(m_fallPackagePath);
m_packagePath = QFINDTESTDATA("data/testfallbackpackage"); m_packagePath = QFINDTESTDATA("data/testfallbackpackage");
m_pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic"); m_pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
@ -39,32 +39,32 @@ void FallbackPackageTest::initTestCase()
void FallbackPackageTest::beforeFallback() void FallbackPackageTest::beforeFallback()
{ {
QVERIFY(m_fallPkg.hasValidStructure()); QVERIFY(m_fallbackPkg.hasValidStructure());
QVERIFY(m_pkg.hasValidStructure()); QVERIFY(m_pkg.hasValidStructure());
//m_fallPkg should have otherfile.qml, m_pkg shouldn't //m_fallbackPkg should have otherfile.qml, m_pkg shouldn't
QVERIFY(!m_fallPkg.filePath("ui", "otherfile.qml").isEmpty()); QVERIFY(!m_fallbackPkg.filePath("ui", "otherfile.qml").isEmpty());
QVERIFY(m_pkg.filePath("ui", "otherfile.qml").isEmpty()); QVERIFY(m_pkg.filePath("ui", "otherfile.qml").isEmpty());
} }
void FallbackPackageTest::afterFallback() void FallbackPackageTest::afterFallback()
{ {
m_pkg.setFallbackPackage(m_fallPkg); m_pkg.setFallbackPackage(m_fallbackPkg);
//after setting the fallback, m_pkg should resolve the exact same file as m_fallPkg //after setting the fallback, m_pkg should resolve the exact same file as m_fallbackPkg
// for otherfile.qml // for otherfile.qml
QVERIFY(!m_pkg.filePath("ui", "otherfile.qml").isEmpty()); QVERIFY(!m_pkg.filePath("ui", "otherfile.qml").isEmpty());
QCOMPARE(m_fallPkg.filePath("ui", "otherfile.qml"), m_pkg.filePath("ui", "otherfile.qml")); QCOMPARE(m_fallbackPkg.filePath("ui", "otherfile.qml"), m_pkg.filePath("ui", "otherfile.qml"));
QVERIFY(m_fallPkg.filePath("mainscript") != m_pkg.filePath("mainscript")); QVERIFY(m_fallbackPkg.filePath("mainscript") != m_pkg.filePath("mainscript"));
} }
void FallbackPackageTest::cycle() void FallbackPackageTest::cycle()
{ {
m_fallPkg.setFallbackPackage(m_pkg); m_fallbackPkg.setFallbackPackage(m_pkg);
m_pkg.setFallbackPackage(m_fallPkg); m_pkg.setFallbackPackage(m_fallbackPkg);
//The cycle should have been detected and filePath should take a not infinite time //The cycle should have been detected and filePath should take a not infinite time
QTRY_COMPARE_WITH_TIMEOUT(m_fallPkg.filePath("ui", "otherfile.qml"), m_pkg.filePath("ui", "otherfile.qml"), 1000); QTRY_COMPARE_WITH_TIMEOUT(m_fallbackPkg.filePath("ui", "otherfile.qml"), m_pkg.filePath("ui", "otherfile.qml"), 1000);
} }
QTEST_MAIN(FallbackPackageTest) QTEST_MAIN(FallbackPackageTest)

View File

@ -37,7 +37,7 @@ private Q_SLOTS:
private: private:
Plasma::Package m_pkg; Plasma::Package m_pkg;
Plasma::Package m_fallPkg; Plasma::Package m_fallbackPkg;
QString m_packagePath; QString m_packagePath;
QString m_fallPackagePath; QString m_fallPackagePath;
}; };