Commit 27d05c9a authored by Bernhard Beschow's avatar Bernhard Beschow
Browse files

MarbleMapTest, MarbleWidgetTest: add test cases for switching themes

parent 36fcecde
......@@ -212,7 +212,8 @@ void PluginManagerPrivate::loadPlugins()
}
m_pluginsLoaded = true;
qDebug("Time elapsed: %d ms", t.elapsed());
mDebug() << Q_FUNC_INFO << "Time elapsed:" << t.elapsed() << "ms";
}
}
......
......@@ -74,6 +74,8 @@ class MarbleMapTest : public QObject
void setMapTheme_data();
void setMapTheme();
void switchMapThemes();
void paint_data();
void paint();
......@@ -489,6 +491,25 @@ void MarbleMapTest::setMapTheme()
QThreadPool::globalInstance()->waitForDone(); // wait for all runners to terminate
}
void MarbleMapTest::switchMapThemes()
{
MarbleMap map;
map.setMapThemeId( "earth/plain/plain.dgml" );
QCOMPARE( map.mapThemeId(), QString( "earth/plain/plain.dgml" ) );
map.setMapThemeId( "earth/srtm/srtm.dgml" );
QCOMPARE( map.mapThemeId(), QString( "earth/srtm/srtm.dgml" ) );
map.setMapThemeId( "earth/openstreetmap/openstreetmap.dgml" );
QCOMPARE( map.mapThemeId(), QString( "earth/openstreetmap/openstreetmap.dgml" ) );
map.setMapThemeId( "earth/plain/plain.dgml" );
QCOMPARE( map.mapThemeId(), QString( "earth/plain/plain.dgml" ) );
QThreadPool::globalInstance()->waitForDone(); // wait for all runners to terminate
}
void MarbleMapTest::paint_data()
{
QTest::addColumn<QString>( "mapThemeId" );
......
......@@ -29,6 +29,8 @@ private slots:
void setMapTheme_data();
void setMapTheme();
void switchMapThemes();
void paintEvent_data();
void paintEvent();
};
......@@ -67,6 +69,25 @@ void MarbleWidgetTest::setMapTheme()
QThreadPool::globalInstance()->waitForDone(); // wait for all runners to terminate
}
void MarbleWidgetTest::switchMapThemes()
{
MarbleWidget widget;
widget.setMapThemeId( "earth/plain/plain.dgml" );
QCOMPARE( widget.mapThemeId(), QString( "earth/plain/plain.dgml" ) );
widget.setMapThemeId( "earth/srtm/srtm.dgml" );
QCOMPARE( widget.mapThemeId(), QString( "earth/srtm/srtm.dgml" ) );
widget.setMapThemeId( "earth/openstreetmap/openstreetmap.dgml" );
QCOMPARE( widget.mapThemeId(), QString( "earth/openstreetmap/openstreetmap.dgml" ) );
widget.setMapThemeId( "earth/plain/plain.dgml" );
QCOMPARE( widget.mapThemeId(), QString( "earth/plain/plain.dgml" ) );
QThreadPool::globalInstance()->waitForDone(); // wait for all runners to terminate
}
void MarbleWidgetTest::paintEvent_data()
{
QTest::addColumn<QString>( "mapThemeId" );
......
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