diff options
author | abcd <qt-info@nokia.com> | 2011-07-28 20:57:23 +1000 |
---|---|---|
committer | abcd <qt_abcd1@ovi.com> | 2011-08-08 08:49:27 +0200 |
commit | 38e2574bf27f66100bf9ec16592f938a4b7a02b1 (patch) | |
tree | 2442df21f70666f6eebc0fa5a318cfcf3f851a0d /tests/auto | |
parent | 1ed859206a408b52335228b4792851378891e4bf (diff) | |
download | qtlocation-38e2574bf27f66100bf9ec16592f938a4b7a02b1.tar.gz |
Move visibility scope for searching into QPlaceSearchQuery
Also remove supportedSearchVisibiltyScopes() from QPlaceManager.
Mainly it should be a documentation issue for whether a particular
manager supports public or private place searching
Change-Id: Icbd21238151f1100614423a942a7363f13e25837
Reviewed-on: http://codereview.qt.nokia.com/2335
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Reviewed-by: abcd <qt_abcd1@ovi.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.h | 1 | ||||
-rw-r--r-- | tests/auto/qplacesearchquery/tst_qplacesearchquery.cpp | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.h b/tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.h index 8b75b033..d1f28840 100644 --- a/tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.h +++ b/tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.h @@ -60,7 +60,6 @@ public: QGeoSearchManagerEngine* createSearchManagerEngine(const QMap<QString, QVariant> ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const; - }; #endif diff --git a/tests/auto/qplacesearchquery/tst_qplacesearchquery.cpp b/tests/auto/qplacesearchquery/tst_qplacesearchquery.cpp index 8a0f459a..38a9839b 100644 --- a/tests/auto/qplacesearchquery/tst_qplacesearchquery.cpp +++ b/tests/auto/qplacesearchquery/tst_qplacesearchquery.cpp @@ -22,6 +22,7 @@ private Q_SLOTS: void boundingBoxTest(); void searchAreaTest(); void didYouMeanSuggestionNumberTest(); + void visibilityScopeTest(); void operatorsTest(); }; @@ -128,6 +129,17 @@ void tst_QPlaceSearchQuery::didYouMeanSuggestionNumberTest() QVERIFY2(testObj.didYouMeanSuggestionNumber() == 0, "Wrong cleared value returned"); } +void tst_QPlaceSearchQuery::visibilityScopeTest() +{ + QPlaceSearchQuery query; + QVERIFY2(query.visibilityScope() == QPlaceManager::NoScope, "Wrong default value"); + query.setVisibilityScope(QPlaceManager::PublicScope); + QCOMPARE(query.visibilityScope(), QPlaceManager::PublicScope); + query.setVisibilityScope(QPlaceManager::PublicAndPrivateScope); + QVERIFY(query.visibilityScope() & QPlaceManager::PublicScope); + QVERIFY(query.visibilityScope() & QPlaceManager::PrivateScope); +} + void tst_QPlaceSearchQuery::operatorsTest() { QPlaceSearchQuery testObj; @@ -172,6 +184,17 @@ void tst_QPlaceSearchQuery::operatorsTest() testObj.setSearchArea(b4); testObj2.setSearchArea(c4); QVERIFY2(testObj != testObj2, "Circle and box identified as matching"); + + //test that identical visibility scopes match + testObj.clear(); + testObj2.clear(); + testObj.setVisibilityScope(QPlaceManager::PublicScope); + testObj2.setVisibilityScope(QPlaceManager::PublicScope); + QVERIFY2(testObj == testObj2, "Identical scopes not identified as matching"); + + //test that different scopes do not match + testObj2.setVisibilityScope(QPlaceManager::PublicScope | QPlaceManager::PrivateScope); + QVERIFY2(testObj != testObj2, "Different scopes identified as matching"); } QTEST_APPLESS_MAIN(tst_QPlaceSearchQuery); |