Qnx: Fix broken configuration manager test

The change 0e67b293b7
broke the configuration manager test since
the manager gets now instantiated when loading the plugin
whereas the test assumes that it would be instantiated
when ::instance() is called the first time.

Change-Id: I8f873fa56305da37590e401e8cfb98b8c92fe89d
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
This commit is contained in:
El Mehdi Fekari
2014-05-19 11:47:36 +02:00
committed by Mehdi Fekari
parent 6f6dbe23b8
commit 5962f2b5b1
3 changed files with 18 additions and 0 deletions

View File

@@ -258,6 +258,19 @@ void BlackBerryConfigurationManager::emitSettingsChanged()
emit settingsChanged();
}
#ifdef WITH_TESTS
void BlackBerryConfigurationManager::initUnitTest()
{
foreach (BlackBerryApiLevelConfiguration *apiLevel, m_apiLevels)
removeApiLevel(apiLevel);
foreach (BlackBerryRuntimeConfiguration *runtime, m_runtimes)
removeRuntime(runtime);
m_defaultConfiguration = 0;
}
#endif
void BlackBerryConfigurationManager::setKitsAutoDetectionSource()
{
foreach (Kit *kit, KitManager::kits()) {

View File

@@ -82,6 +82,10 @@ public:
void emitSettingsChanged();
#ifdef WITH_TESTS
void initUnitTest();
#endif
public slots:
void loadSettings();
void saveSettings();

View File

@@ -482,6 +482,7 @@ void QnxPlugin::testConfigurationManager_data()
void QnxPlugin::testConfigurationManager()
{
BlackBerryConfigurationManager *manager = BlackBerryConfigurationManager::instance();
manager->initUnitTest();
QCOMPARE(manager->apiLevels().count(), 0);
QCOMPARE(manager->activeApiLevels().count(), 0);