summaryrefslogtreecommitdiff
path: root/tests/auto/qplacemanager
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2011-08-03 19:00:00 +1000
committerabcd <qt_abcd1@ovi.com>2011-08-10 05:10:18 +0200
commit4e570cc94fd10dd92ec1dbb117964d3a9748f48b (patch)
tree5538cfb4bd00c1a78f5aef018a36f40b12b59a2d /tests/auto/qplacemanager
parent44e38960cfe3a999954b470e6e5e2b9a03215220 (diff)
downloadqtlocation-4e570cc94fd10dd92ec1dbb117964d3a9748f48b.tar.gz
Add placemanager unit test (skeleton)
For now we just test whether we can instantiate a placemanager from a geoserviceprovider. It is expected this unit test will be expanded in future. Change-Id: I891b927c45136442805113f0bfac17d46cda2276 Reviewed-on: http://codereview.qt.nokia.com/2549 Reviewed-by: abcd <qt_abcd1@ovi.com>
Diffstat (limited to 'tests/auto/qplacemanager')
-rw-r--r--tests/auto/qplacemanager/qplacemanager.pro7
-rw-r--r--tests/auto/qplacemanager/tst_qplacemanager.cpp41
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/auto/qplacemanager/qplacemanager.pro b/tests/auto/qplacemanager/qplacemanager.pro
new file mode 100644
index 00000000..76c898c4
--- /dev/null
+++ b/tests/auto/qplacemanager/qplacemanager.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+CONFIG += testcase
+TARGET = tst_qplacemanager
+
+SOURCES += tst_qplacemanager.cpp
+
+QT += location testlib
diff --git a/tests/auto/qplacemanager/tst_qplacemanager.cpp b/tests/auto/qplacemanager/tst_qplacemanager.cpp
new file mode 100644
index 00000000..e2c73486
--- /dev/null
+++ b/tests/auto/qplacemanager/tst_qplacemanager.cpp
@@ -0,0 +1,41 @@
+#include <QString>
+#include <QtTest/QtTest>
+
+#include <qgeoserviceprovider.h>
+#include <qplacemanager.h>
+
+QT_USE_NAMESPACE
+
+class tst_QPlaceManager : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QPlaceManager();
+
+private Q_SLOTS:
+ void initTestCase();
+
+private:
+ QGeoServiceProvider *provider;
+ QPlaceManager *placeManager;
+};
+
+tst_QPlaceManager::tst_QPlaceManager()
+{
+}
+
+void tst_QPlaceManager::initTestCase()
+{
+ QStringList providers = QGeoServiceProvider::availableServiceProviders();
+ providers.contains("qmlgeo.test.plugin");
+
+ provider = new QGeoServiceProvider("qmlgeo.test.plugin");
+ placeManager = provider->placeManager();
+ QVERIFY(placeManager);
+
+ QVERIFY(placeManager->connectivityMode() == QPlaceManager::OnlineMode);
+}
+
+QTEST_MAIN(tst_QPlaceManager)
+
+#include "tst_qplacemanager.moc"