summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorabcd <amos.choy@nokia.com>2012-06-26 16:48:01 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-02 10:26:05 +0200
commitc1e1a57dca0d9a7d4255bada8ba724a8c95a1fd8 (patch)
treeeec9529a14e765d1901d506cf0ee76c661d04698 /tests
parent3a5778262a3d41359f17739f661fa02e0207b628 (diff)
downloadqtlocation-c1e1a57dca0d9a7d4255bada8ba724a8c95a1fd8.tar.gz
Add utility function to help test search suggestions
Change-Id: I28f6bfe2c311d25f4893e0db674c2b85323a10e1 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/placemanager_utils/placemanager_utils.cpp15
-rw-r--r--tests/auto/placemanager_utils/placemanager_utils.h11
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/placemanager_utils/placemanager_utils.cpp b/tests/auto/placemanager_utils/placemanager_utils.cpp
index a18522e3..72bb002b 100644
--- a/tests/auto/placemanager_utils/placemanager_utils.cpp
+++ b/tests/auto/placemanager_utils/placemanager_utils.cpp
@@ -138,6 +138,21 @@ bool PlaceManagerUtils::doSearch(QPlaceManager *manager,
return success;
}
+bool PlaceManagerUtils::doSearchSuggestions(QPlaceManager *manager,
+ const QPlaceSearchRequest &request,
+ QStringList *results,
+ QPlaceReply::Error expectedError)
+{
+ QPlaceSearchSuggestionReply *reply = manager->searchSuggestions(request);
+ bool success = checkSignals(reply, expectedError, manager);
+ *results = reply->suggestions();
+
+ if (!success)
+ qDebug() << "Error string = " << reply->errorString();
+
+ return success;
+}
+
bool PlaceManagerUtils::doRemovePlace(QPlaceManager *manager,
const QPlace &place,
QPlaceReply::Error expectedError)
diff --git a/tests/auto/placemanager_utils/placemanager_utils.h b/tests/auto/placemanager_utils/placemanager_utils.h
index 3effb563..cf9f362e 100644
--- a/tests/auto/placemanager_utils/placemanager_utils.h
+++ b/tests/auto/placemanager_utils/placemanager_utils.h
@@ -95,6 +95,11 @@ public:
QList<QPlace> *results,
QPlaceReply::Error expectedError = QPlaceReply::NoError);
+ static bool doSearchSuggestions(QPlaceManager *manager,
+ const QPlaceSearchRequest &request,
+ QStringList *results,
+ QPlaceReply::Error expectedError = QPlaceReply::NoError);
+
static bool doRemovePlace(QPlaceManager *manager, const QPlace &place,
QPlaceReply::Error expectedError = QPlaceReply::NoError);
@@ -162,6 +167,12 @@ protected:
return doSearch(placeManager, request, results,expectedError);
}
+ bool doSearchSuggestions(const QPlaceSearchRequest &request,
+ QStringList *results,
+ QPlaceReply::Error expectedError) {
+ return doSearchSuggestions(placeManager, request, results, expectedError);
+ }
+
bool doFetchDetails(QString placeId,
QPlace *place,
QPlaceReply::Error expectedError = QPlaceReply::NoError) {