From 38e2574bf27f66100bf9ec16592f938a4b7a02b1 Mon Sep 17 00:00:00 2001 From: abcd Date: Thu, 28 Jul 2011 20:57:23 +1000 Subject: 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 Reviewed-by: Aaron McCarthy Reviewed-by: abcd --- .../qgeoserviceproviderplugin_test.h | 1 - .../qplacesearchquery/tst_qplacesearchquery.cpp | 23 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'tests/auto') 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 ¶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); -- cgit v1.2.1