Commit 5962f2b5 authored by El Mehdi Fekari's avatar El Mehdi Fekari Committed by Mehdi Fekari

Qnx: Fix broken configuration manager test

The change 0e67b293
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: default avatarChristian Stenger <christian.stenger@digia.com>
Reviewed-by: default avatarSergio Ahumada <sahumada@blackberry.com>
parent 6f6dbe23
......@@ -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()) {
......
......@@ -82,6 +82,10 @@ public:
void emitSettingsChanged();
#ifdef WITH_TESTS
void initUnitTest();
#endif
public slots:
void loadSettings();
void saveSettings();
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment