diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 6 | ||||
-rw-r--r-- | tests/auto/geotestplugin/geotestplugin.pro | 2 | ||||
-rw-r--r-- | tests/auto/geotestplugin/qgeocodingmanagerengine_test.h (renamed from tests/auto/geotestplugin/qgeosearchmanagerengine_test.h) | 92 | ||||
-rw-r--r-- | tests/auto/geotestplugin/qgeoserviceproviderplugin_test.cpp | 6 | ||||
-rw-r--r-- | tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h | 2 | ||||
-rw-r--r-- | tests/auto/qgeocodereply/qgeocodereply.pro (renamed from tests/auto/qgeosearchreply/qgeosearchreply.pro) | 6 | ||||
-rw-r--r-- | tests/auto/qgeocodereply/tst_qgeocodereply.cpp (renamed from tests/auto/qgeosearchreply/tst_qgeosearchreply.cpp) | 96 | ||||
-rw-r--r-- | tests/auto/qgeocodereply/tst_qgeocodereply.h (renamed from tests/auto/qgeosearchreply/tst_qgeosearchreply.h) | 22 | ||||
-rw-r--r-- | tests/auto/qgeocodingmanager/qgeocodingmanager.pro (renamed from tests/auto/qgeosearchmanager/qgeosearchmanager.pro) | 4 | ||||
-rw-r--r-- | tests/auto/qgeocodingmanager/tst_qgeocodingmanager.cpp (renamed from tests/auto/qgeosearchmanager/tst_qgeosearchmanager.cpp) | 70 | ||||
-rw-r--r-- | tests/auto/qgeocodingmanager/tst_qgeocodingmanager.h (renamed from tests/auto/qgeosearchmanager/tst_qgeosearchmanager.h) | 18 | ||||
-rw-r--r-- | tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerengine_test.h (renamed from tests/auto/qgeosearchmanagerplugins/qgeosearchmanagerengine_test.h) | 66 | ||||
-rw-r--r-- | tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerplugins.pro (renamed from tests/auto/qgeosearchmanagerplugins/qgeosearchmanagerplugins.pro) | 4 | ||||
-rw-r--r-- | tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.cpp (renamed from tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.cpp) | 10 | ||||
-rw-r--r-- | tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.h (renamed from tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.h) | 2 |
15 files changed, 203 insertions, 203 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index ab7cdd37..da8f8011 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -7,15 +7,15 @@ TEMPLATE = subdirs CONFIG += ordered SUBDIRS += geotestplugin \ - qgeosearchmanagerplugins \ + qgeocodingmanagerplugins \ qgeoaddress \ qgeoboundingbox \ qgeoboundingcircle \ qgeocoordinate \ qgeolocation \ qgeoplace \ - qgeosearchreply \ - qgeosearchmanager \ + qgeocodereply \ + qgeocodingmanager \ qplacebusinessfeature \ qplacecategory \ qplacedescription \ diff --git a/tests/auto/geotestplugin/geotestplugin.pro b/tests/auto/geotestplugin/geotestplugin.pro index 62febab2..c46db272 100644 --- a/tests/auto/geotestplugin/geotestplugin.pro +++ b/tests/auto/geotestplugin/geotestplugin.pro @@ -10,7 +10,7 @@ include($$QT_SOURCE_TREE/src/plugins/qpluginbase.pri) # TODO not sure where to put test plugins in Qt 5 DESTDIR = $$QT.location.plugins/geoservices -HEADERS += qgeosearchmanagerengine_test.h \ +HEADERS += qgeocodingmanagerengine_test.h \ qgeoserviceproviderplugin_test.h \ qgeoroutingmanagerengine_test.h diff --git a/tests/auto/geotestplugin/qgeosearchmanagerengine_test.h b/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h index b0d04a28..6c21e4f3 100644 --- a/tests/auto/geotestplugin/qgeosearchmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeocodingmanagerengine_test.h @@ -39,16 +39,16 @@ ** ****************************************************************************/ -#ifndef QGEOSEARCHMANAGERENGINE_TEST_H -#define QGEOSEARCHMANAGERENGINE_TEST_H +#ifndef QGEOCODINGMANAGERENGINE_TEST_H +#define QGECODINGMANAGERENGINE_TEST_H #include <qgeoserviceprovider.h> -#include <qgeosearchmanagerengine.h> +#include <qgeocodingmanagerengine.h> #include <QLocale> #include <qlandmarkmanager.h> #include <qgeoaddress.h> #include <qgeolocation.h> -#include <qgeosearchreply.h> +#include <qgeocodereply.h> #include <QTimer> #include <QTimerEvent> @@ -56,11 +56,11 @@ QT_USE_NAMESPACE -class SearchReplyTest :public QGeoSearchReply +class GeocodeReplyTest :public QGeocodeReply { Q_OBJECT public: - SearchReplyTest(QObject *parent=0):QGeoSearchReply (parent) {} + GeocodeReplyTest(QObject *parent=0):QGeocodeReply (parent) {} void callAddLocation ( const QGeoLocation & location ) {addLocation(location);} void callSetError ( Error error, const QString & errorString ) {setError(error, errorString);} @@ -76,20 +76,20 @@ Q_SIGNALS: void aborted(); }; -class QGeoSearchManagerEngineTest: public QGeoSearchManagerEngine +class QGeocodingManagerEngineTest: public QGeocodingManagerEngine { Q_OBJECT public: - QGeoSearchManagerEngineTest(const QMap<QString, QVariant> ¶meters, + QGeocodingManagerEngineTest(const QMap<QString, QVariant> ¶meters, QGeoServiceProvider::Error *error, QString *errorString) : - QGeoSearchManagerEngine(parameters), + QGeocodingManagerEngine(parameters), validateWellKnownValues_(false), finishRequestImmediately_(true), supported_(true), - searchReply_(0), + geocodeReply_(0), timerId_(0), - errorCode_(QGeoSearchReply::NoError) + errorCode_(QGeocodeReply::NoError) { Q_UNUSED(error) Q_UNUSED(errorString) @@ -105,45 +105,45 @@ public: setLocale(*(new QLocale (QLocale::German, QLocale::Germany))); } - QGeoSearchReply* geocode ( const QGeoAddress & address, QGeoBoundingArea * bounds ) + QGeocodeReply* geocode ( const QGeoAddress & address, QGeoBoundingArea * bounds ) { - searchReply_ = new SearchReplyTest(); - connect(searchReply_, SIGNAL(aborted()), this, SLOT(requestAborted())); - searchReply_->callSetViewport(bounds); + geocodeReply_ = new GeocodeReplyTest(); + connect(geocodeReply_, SIGNAL(aborted()), this, SLOT(requestAborted())); + geocodeReply_->callSetViewport(bounds); if (address.street().startsWith("error")) { errorString_ = address.street(); - errorCode_ = (QGeoSearchReply::Error)address.county().toInt(); + errorCode_ = (QGeocodeReply::Error)address.county().toInt(); } else { errorString_ = ""; - errorCode_ = QGeoSearchReply::NoError; + errorCode_ = QGeocodeReply::NoError; } // 1. Check if we are to validate values if (validateWellKnownValues_) { if (address.street() != "wellknown street") { - searchReply_->callSetError(QGeoSearchReply::EngineNotSetError, address.street()); + geocodeReply_->callSetError(QGeocodeReply::EngineNotSetError, address.street()); } else { - searchReply_->callSetError(QGeoSearchReply::NoError,address.street()); + geocodeReply_->callSetError(QGeocodeReply::NoError,address.street()); } } // 2. Set the locations into the reply - setLocations(searchReply_, address); + setLocations(geocodeReply_, address); // 3. Finish the request if (finishRequestImmediately_) { // check if we should finish with error if (errorCode_) { - searchReply_->callSetError(errorCode_, errorString_); + geocodeReply_->callSetError(errorCode_, errorString_); } else { - searchReply_->callSetFinished(true); + geocodeReply_->callSetFinished(true); } } else { // we only allow serialized requests in QML - previous must have been aborted Q_ASSERT(timerId_ == 0); timerId_ = startTimer(200); } - return static_cast<QGeoSearchReply*>(searchReply_); + return static_cast<QGeocodeReply*>(geocodeReply_); } public Q_SLOTS: @@ -154,11 +154,11 @@ public Q_SLOTS: timerId_ = 0; } errorString_ = ""; - errorCode_ = QGeoSearchReply::NoError; + errorCode_ = QGeocodeReply::NoError; } public: - void setLocations(SearchReplyTest* reply, const QString searchString, int limit ) + void setLocations(GeocodeReplyTest* reply, const QString searchString, int limit ) { for (int i = 0; i < limit; ++i) { QGeoLocation location; @@ -169,7 +169,7 @@ public: } } - void setLocations(SearchReplyTest* reply, const QGeoAddress& address) + void setLocations(GeocodeReplyTest* reply, const QGeoAddress& address) { int count = address.county().toInt(); @@ -180,7 +180,7 @@ public: } } - void setLocations(SearchReplyTest* reply, const QGeoCoordinate & coordinate) + void setLocations(GeocodeReplyTest* reply, const QGeoCoordinate & coordinate) { for (int i = 0; i < coordinate.longitude(); ++i) { QGeoLocation location; @@ -189,60 +189,60 @@ public: } } - QGeoSearchReply* reverseGeocode ( const QGeoCoordinate & coordinate, QGeoBoundingArea * bounds ) + QGeocodeReply* reverseGeocode ( const QGeoCoordinate & coordinate, QGeoBoundingArea * bounds ) { - searchReply_ = new SearchReplyTest(); - connect(searchReply_, SIGNAL(aborted()), this, SLOT(requestAborted())); + geocodeReply_ = new GeocodeReplyTest(); + connect(geocodeReply_, SIGNAL(aborted()), this, SLOT(requestAborted())); - setLocations(searchReply_, coordinate); - searchReply_->callSetViewport(bounds); + setLocations(geocodeReply_, coordinate); + geocodeReply_->callSetViewport(bounds); if (coordinate.latitude() > 70) { errorString_ = "error"; - errorCode_ = (QGeoSearchReply::Error) (coordinate.latitude() - 70); + errorCode_ = (QGeocodeReply::Error) (coordinate.latitude() - 70); } else { errorString_ = ""; - errorCode_ = QGeoSearchReply::NoError; + errorCode_ = QGeocodeReply::NoError; } if (finishRequestImmediately_) { if (errorCode_) { - searchReply_->callSetError(errorCode_, errorString_); + geocodeReply_->callSetError(errorCode_, errorString_); } else { - searchReply_->callSetError(QGeoSearchReply::NoError,coordinate.toString()); - searchReply_->callSetFinished(true); + geocodeReply_->callSetError(QGeocodeReply::NoError,coordinate.toString()); + geocodeReply_->callSetFinished(true); } } else { // we only allow serialized requests in QML - previous must have been aborted or finished Q_ASSERT(timerId_ == 0); timerId_ = startTimer(200); } - return static_cast<QGeoSearchReply*>(searchReply_); + return static_cast<QGeocodeReply*>(geocodeReply_); } protected: void timerEvent(QTimerEvent *event) { Q_ASSERT(timerId_ == event->timerId()); - Q_ASSERT(searchReply_); + Q_ASSERT(geocodeReply_); killTimer(timerId_); timerId_ = 0; if (errorCode_) { - searchReply_->callSetError(errorCode_, errorString_); - emit error(searchReply_, errorCode_, errorString_); + geocodeReply_->callSetError(errorCode_, errorString_); + emit error(geocodeReply_, errorCode_, errorString_); } else { - searchReply_->callSetError(QGeoSearchReply::NoError, "no error"); - searchReply_->callSetFinished(true); + geocodeReply_->callSetError(QGeocodeReply::NoError, "no error"); + geocodeReply_->callSetFinished(true); } - emit finished(searchReply_); + emit finished(geocodeReply_); } private: bool validateWellKnownValues_; bool finishRequestImmediately_; bool supported_; - SearchReplyTest* searchReply_; + GeocodeReplyTest* geocodeReply_; int timerId_; - QGeoSearchReply::Error errorCode_; + QGeocodeReply::Error errorCode_; QString errorString_; }; diff --git a/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.cpp b/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.cpp index 41d961d4..4bf9f2c7 100644 --- a/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.cpp +++ b/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qgeoserviceproviderplugin_test.h" -#include "qgeosearchmanagerengine_test.h" +#include "qgeocodingmanagerengine_test.h" #include "qgeoroutingmanagerengine_test.h" #include <QtPlugin> @@ -71,10 +71,10 @@ QGeoRoutingManagerEngine* QGeoServiceProviderFactoryTest::createRoutingManagerEn } -QGeoSearchManagerEngine* QGeoServiceProviderFactoryTest::createSearchManagerEngine(const QMap< +QGeocodingManagerEngine* QGeoServiceProviderFactoryTest::createGeocodingManagerEngine(const QMap< QString, QVariant> ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const { - return new QGeoSearchManagerEngineTest(parameters, error, errorString); + return new QGeocodingManagerEngineTest(parameters, error, errorString); } diff --git a/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h b/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h index 6c4d90ba..2ebac422 100644 --- a/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h +++ b/tests/auto/geotestplugin/qgeoserviceproviderplugin_test.h @@ -65,7 +65,7 @@ public: QGeoRoutingManagerEngine* createRoutingManagerEngine ( const QMap<QString, QVariant> & parameters, QGeoServiceProvider::Error * error, QString * errorString ) const; - QGeoSearchManagerEngine* createSearchManagerEngine( + QGeocodingManagerEngine* createGeocodingManagerEngine( const QMap<QString, QVariant> ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const; diff --git a/tests/auto/qgeosearchreply/qgeosearchreply.pro b/tests/auto/qgeocodereply/qgeocodereply.pro index c51de38a..a36435af 100644 --- a/tests/auto/qgeosearchreply/qgeosearchreply.pro +++ b/tests/auto/qgeocodereply/qgeocodereply.pro @@ -1,10 +1,10 @@ TEMPLATE = app CONFIG += testcase -TARGET = tst_qgeosearchreply +TARGET = tst_qgeocodereply HEADERS += ../qgeocoordinate/qlocationtestutils_p.h \ - tst_qgeosearchreply.h -SOURCES += tst_qgeosearchreply.cpp \ + tst_qgeocodereply.h +SOURCES += tst_qgeocodereply.cpp \ ../qgeocoordinate/qlocationtestutils.cpp QT += location testlib diff --git a/tests/auto/qgeosearchreply/tst_qgeosearchreply.cpp b/tests/auto/qgeocodereply/tst_qgeocodereply.cpp index 0ec9c28f..1c052fed 100644 --- a/tests/auto/qgeosearchreply/tst_qgeosearchreply.cpp +++ b/tests/auto/qgeocodereply/tst_qgeocodereply.cpp @@ -39,43 +39,43 @@ ** ****************************************************************************/ -#include "tst_qgeosearchreply.h" +#include "tst_qgeocodereply.h" QT_USE_NAMESPACE -void tst_QGeoSearchReply::initTestCase() +void tst_QGeocodeReply::initTestCase() { - reply = new SubSearchReply(); + reply = new SubGeocodeReply(); } -void tst_QGeoSearchReply::cleanupTestCase() +void tst_QGeocodeReply::cleanupTestCase() { delete reply; delete qgeolocation; } -void tst_QGeoSearchReply::init() +void tst_QGeocodeReply::init() { - qRegisterMetaType<QGeoSearchReply::Error>("Error"); - signalerror = new QSignalSpy(reply, SIGNAL(error(QGeoSearchReply::Error,const QString))); + qRegisterMetaType<QGeocodeReply::Error>("Error"); + signalerror = new QSignalSpy(reply, SIGNAL(error(QGeocodeReply::Error,const QString))); signalfinished = new QSignalSpy(reply, SIGNAL(finished())); } -void tst_QGeoSearchReply::cleanup() +void tst_QGeocodeReply::cleanup() { delete signalerror; delete signalfinished; } -void tst_QGeoSearchReply::constructor() +void tst_QGeocodeReply::constructor() { QVERIFY(!reply->isFinished()); QCOMPARE(reply->limit(),-1); QCOMPARE(reply->offset(),0); - QCOMPARE(reply->error(),QGeoSearchReply::NoError); + QCOMPARE(reply->error(),QGeocodeReply::NoError); QVERIFY( signalerror->isValid() ); QVERIFY( signalfinished->isValid() ); @@ -84,58 +84,58 @@ void tst_QGeoSearchReply::constructor() QCOMPARE(signalfinished->count(),0); } -void tst_QGeoSearchReply::constructor_error() +void tst_QGeocodeReply::constructor_error() { - QFETCH(QGeoSearchReply::Error,error); + QFETCH(QGeocodeReply::Error,error); QFETCH(QString,msg); QVERIFY( signalerror->isValid() ); QVERIFY( signalfinished->isValid() ); - QGeoSearchReply *qgeosearchreplycopy = new QGeoSearchReply (error,msg,0); + QGeocodeReply *qgeocodereplycopy = new QGeocodeReply (error,msg,0); QCOMPARE(signalerror->count(),0); QCOMPARE(signalfinished->count(),0); - QCOMPARE (qgeosearchreplycopy->error(),error); - QCOMPARE (qgeosearchreplycopy->errorString(),msg); + QCOMPARE (qgeocodereplycopy->error(),error); + QCOMPARE (qgeocodereplycopy->errorString(),msg); - delete qgeosearchreplycopy; + delete qgeocodereplycopy; } -void tst_QGeoSearchReply::constructor_error_data() +void tst_QGeocodeReply::constructor_error_data() { - QTest::addColumn<QGeoSearchReply::Error>("error"); + QTest::addColumn<QGeocodeReply::Error>("error"); QTest::addColumn<QString>("msg"); - QTest::newRow("error1") << QGeoSearchReply::NoError << "No error."; - QTest::newRow("error2") << QGeoSearchReply::EngineNotSetError << "Engine Not Set Error."; - QTest::newRow("error3") << QGeoSearchReply::CommunicationError << "Communication Error."; - QTest::newRow("error4") << QGeoSearchReply::ParseError << "Parse Error."; - QTest::newRow("error5") << QGeoSearchReply::UnsupportedOptionError << "Unsupported Option Error."; - QTest::newRow("error6") << QGeoSearchReply::UnknownError << "Unknown Error."; + QTest::newRow("error1") << QGeocodeReply::NoError << "No error."; + QTest::newRow("error2") << QGeocodeReply::EngineNotSetError << "Engine Not Set Error."; + QTest::newRow("error3") << QGeocodeReply::CommunicationError << "Communication Error."; + QTest::newRow("error4") << QGeocodeReply::ParseError << "Parse Error."; + QTest::newRow("error5") << QGeocodeReply::UnsupportedOptionError << "Unsupported Option Error."; + QTest::newRow("error6") << QGeocodeReply::UnknownError << "Unknown Error."; } -void tst_QGeoSearchReply::destructor() +void tst_QGeocodeReply::destructor() { - QGeoSearchReply *qgeosearchreplycopy; - QFETCH(QGeoSearchReply::Error,error); + QGeocodeReply *qgeocodereplycopy; + QFETCH(QGeocodeReply::Error,error); QFETCH(QString,msg); QLocationTestUtils::uheap_mark(); - qgeosearchreplycopy = new QGeoSearchReply (error,msg,0); - delete qgeosearchreplycopy; + qgeocodereplycopy = new QGeocodeReply (error,msg,0); + delete qgeocodereplycopy; QLocationTestUtils::uheap_mark_end(); } -void tst_QGeoSearchReply::destructor_data() +void tst_QGeocodeReply::destructor_data() { - tst_QGeoSearchReply::constructor_error_data(); + tst_QGeocodeReply::constructor_error_data(); } -void tst_QGeoSearchReply::abort() +void tst_QGeocodeReply::abort() { QVERIFY( signalerror->isValid() ); QVERIFY( signalfinished->isValid() ); @@ -157,9 +157,9 @@ void tst_QGeoSearchReply::abort() QCOMPARE (signalfinished->count(),2); } -void tst_QGeoSearchReply::error() +void tst_QGeocodeReply::error() { - QFETCH(QGeoSearchReply::Error,error); + QFETCH(QGeocodeReply::Error,error); QFETCH(QString,msg); QVERIFY( signalerror->isValid() ); @@ -176,20 +176,20 @@ void tst_QGeoSearchReply::error() } -void tst_QGeoSearchReply::error_data() +void tst_QGeocodeReply::error_data() { - QTest::addColumn<QGeoSearchReply::Error>("error"); + QTest::addColumn<QGeocodeReply::Error>("error"); QTest::addColumn<QString>("msg"); - QTest::newRow("error1") << QGeoSearchReply::NoError << "No error."; - QTest::newRow("error2") << QGeoSearchReply::EngineNotSetError << "Engine Not Set Error."; - QTest::newRow("error3") << QGeoSearchReply::CommunicationError << "Communication Error."; - QTest::newRow("error4") << QGeoSearchReply::ParseError << "Parse Error."; - QTest::newRow("error5") << QGeoSearchReply::UnsupportedOptionError << "Unsupported Option Error."; - QTest::newRow("error6") << QGeoSearchReply::UnknownError << "Unknown Error."; + QTest::newRow("error1") << QGeocodeReply::NoError << "No error."; + QTest::newRow("error2") << QGeocodeReply::EngineNotSetError << "Engine Not Set Error."; + QTest::newRow("error3") << QGeocodeReply::CommunicationError << "Communication Error."; + QTest::newRow("error4") << QGeocodeReply::ParseError << "Parse Error."; + QTest::newRow("error5") << QGeocodeReply::UnsupportedOptionError << "Unsupported Option Error."; + QTest::newRow("error6") << QGeocodeReply::UnknownError << "Unknown Error."; } -void tst_QGeoSearchReply::finished() +void tst_QGeocodeReply::finished() { QVERIFY( signalerror->isValid() ); QVERIFY( signalfinished->isValid() ); @@ -217,21 +217,21 @@ void tst_QGeoSearchReply::finished() -void tst_QGeoSearchReply::limit() +void tst_QGeocodeReply::limit() { int limit =30; reply->callSetLimit(limit); QCOMPARE(reply->limit(),limit); } -void tst_QGeoSearchReply::offset() +void tst_QGeocodeReply::offset() { int offset = 2; reply->callSetOffset(offset); QCOMPARE(reply->offset(),offset); } -void tst_QGeoSearchReply::locations() +void tst_QGeocodeReply::locations() { QList <QGeoLocation> geolocations; geolocations = reply->locations(); @@ -274,7 +274,7 @@ void tst_QGeoSearchReply::locations() delete qgeolocationcopy; } -void tst_QGeoSearchReply::viewport() +void tst_QGeocodeReply::viewport() { QGeoCoordinate *qgeocoordinate = new QGeoCoordinate (12.12 , 54.43); @@ -288,4 +288,4 @@ void tst_QGeoSearchReply::viewport() delete qgeoboundingbox; } -QTEST_MAIN(tst_QGeoSearchReply); +QTEST_MAIN(tst_QGeocodeReply); diff --git a/tests/auto/qgeosearchreply/tst_qgeosearchreply.h b/tests/auto/qgeocodereply/tst_qgeocodereply.h index 3a8f8711..94213594 100644 --- a/tests/auto/qgeosearchreply/tst_qgeosearchreply.h +++ b/tests/auto/qgeocodereply/tst_qgeocodereply.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef TST_QGEOSEARCHREPLY_H -#define TST_QGEOSEARCHREPLY_H +#ifndef TST_QGEOCODEREPLY_H +#define TST_QGEOCODEREPLY_H #include <QtCore/QString> #include <QtTest/QtTest> @@ -50,18 +50,18 @@ #include "../qgeocoordinate/qlocationtestutils_p.h" -#include <qgeosearchreply.h> +#include <qgeocodereply.h> #include <qgeolocation.h> #include <qgeoaddress.h> #include <qgeocoordinate.h> #include <qgeoboundingbox.h> QT_USE_NAMESPACE -class SubSearchReply : public QGeoSearchReply +class SubGeocodeReply : public QGeocodeReply { Q_OBJECT public: - SubSearchReply():QGeoSearchReply() {} + SubGeocodeReply():QGeocodeReply() {} void callAddLocation ( const QGeoLocation & location ) {addLocation(location);} void callSetError ( Error error, const QString & errorString ) {setError(error, errorString);} @@ -73,7 +73,7 @@ public: }; -class tst_QGeoSearchReply :public QObject +class tst_QGeocodeReply :public QObject { Q_OBJECT @@ -83,7 +83,7 @@ public slots: void init(); void cleanup(); - //Start Unit Test for QGeoSearchReply + //Start Unit Test for QGeoCodeReply private slots: void constructor(); void constructor_error(); @@ -99,20 +99,20 @@ private slots: void locations(); void viewport(); - //End Unit Test for QGeoSearchReply + //End Unit Test for QGeoCodeReply private: QSignalSpy *signalerror; QSignalSpy *signalfinished; - SubSearchReply* reply; + SubGeocodeReply* reply; QGeoLocation *qgeolocation; QGeoBoundingBox *qgeoboundingbox; }; Q_DECLARE_METATYPE( QList<double>); -Q_DECLARE_METATYPE( QGeoSearchReply::Error); +Q_DECLARE_METATYPE( QGeocodeReply::Error); -#endif // TST_QGEOSEARCHREPLY_H +#endif // TST_QGEOCODEREPLY_H diff --git a/tests/auto/qgeosearchmanager/qgeosearchmanager.pro b/tests/auto/qgeocodingmanager/qgeocodingmanager.pro index fd864c65..dc65c884 100644 --- a/tests/auto/qgeosearchmanager/qgeosearchmanager.pro +++ b/tests/auto/qgeocodingmanager/qgeocodingmanager.pro @@ -1,9 +1,9 @@ load(qttest_p4) HEADERS += ../qgeocoordinate/qlocationtestutils_p.h \ - tst_qgeosearchmanager.h + tst_qgeocodingmanager.h -SOURCES += tst_qgeosearchmanager.cpp \ +SOURCES += tst_qgeocodingmanager.cpp \ ../qgeocoordinate/qlocationtestutils.cpp QT += location diff --git a/tests/auto/qgeosearchmanager/tst_qgeosearchmanager.cpp b/tests/auto/qgeocodingmanager/tst_qgeocodingmanager.cpp index 385ed66f..a58f1c73 100644 --- a/tests/auto/qgeosearchmanager/tst_qgeosearchmanager.cpp +++ b/tests/auto/qgeocodingmanager/tst_qgeocodingmanager.cpp @@ -41,89 +41,89 @@ //TESTED_COMPONENT=src/location -#include "tst_qgeosearchmanager.h" +#include "tst_qgeocodingmanager.h" QT_USE_NAMESPACE -void tst_QGeoSearchManager::initTestCase() +void tst_QGeocodingManager::initTestCase() { - tst_QGeoSearchManager::loadSearchManager(); + tst_QGeocodingManager::loadGeocodingManager(); } -void tst_QGeoSearchManager::cleanupTestCase() +void tst_QGeocodingManager::cleanupTestCase() { delete qgeoserviceprovider; } -void tst_QGeoSearchManager::init() +void tst_QGeocodingManager::init() { - qRegisterMetaType<QGeoSearchReply::Error>("Error"); - qRegisterMetaType<QGeoSearchReply*>(); + qRegisterMetaType<QGeocodeReply::Error>("Error"); + qRegisterMetaType<QGeocodeReply*>(); - signalerror = new QSignalSpy(qgeosearchmanager, SIGNAL(error(QGeoSearchReply*,QGeoSearchReply::Error,QString))); - signalfinished = new QSignalSpy(qgeosearchmanager, SIGNAL(finished(QGeoSearchReply*))); + signalerror = new QSignalSpy(qgeocodingmanager, SIGNAL(error(QGeocodeReply*,QGeocodeReply::Error,QString))); + signalfinished = new QSignalSpy(qgeocodingmanager, SIGNAL(finished(QGeocodeReply*))); QVERIFY( signalerror->isValid() ); QVERIFY( signalfinished->isValid() ); } -void tst_QGeoSearchManager::cleanup() +void tst_QGeocodingManager::cleanup() { delete signalerror; delete signalfinished; } -void tst_QGeoSearchManager::loadSearchManager() +void tst_QGeocodingManager::loadGeocodingManager() { QStringList providers = QGeoServiceProvider::availableServiceProviders(); - QVERIFY(providers.contains("static.geosearch.test.plugin")); + QVERIFY(providers.contains("static.geocode.test.plugin")); - qgeoserviceprovider = new QGeoServiceProvider("static.geosearch.test.plugin"); + qgeoserviceprovider = new QGeoServiceProvider("static.geocode.test.plugin"); QVERIFY(qgeoserviceprovider); QCOMPARE(qgeoserviceprovider->error(), QGeoServiceProvider::NoError); - qgeosearchmanager = qgeoserviceprovider->searchManager(); - QVERIFY(qgeosearchmanager); + qgeocodingmanager = qgeoserviceprovider->geocodingManager(); + QVERIFY(qgeocodingmanager); } -void tst_QGeoSearchManager::supports() +void tst_QGeocodingManager::supports() { - QVERIFY(qgeosearchmanager->supportsGeocoding()); - QVERIFY(qgeosearchmanager->supportsReverseGeocoding()); + QVERIFY(qgeocodingmanager->supportsGeocoding()); + QVERIFY(qgeocodingmanager->supportsReverseGeocoding()); } -void tst_QGeoSearchManager::locale() +void tst_QGeocodingManager::locale() { QLocale *german = new QLocale (QLocale::German, QLocale::Germany); QLocale *english = new QLocale (QLocale::C, QLocale::AnyCountry); //Default Locale from the Search Engine - QCOMPARE(qgeosearchmanager->locale(),*german); + QCOMPARE(qgeocodingmanager->locale(),*german); - qgeosearchmanager->setLocale(*english); + qgeocodingmanager->setLocale(*english); - QCOMPARE(qgeosearchmanager->locale(),*english); + QCOMPARE(qgeocodingmanager->locale(),*english); - QVERIFY(qgeosearchmanager->locale() != *german); + QVERIFY(qgeocodingmanager->locale() != *german); delete german; delete english; } -void tst_QGeoSearchManager::name() +void tst_QGeocodingManager::name() { - QString name = "static.geosearch.test.plugin"; - QCOMPARE(qgeosearchmanager->managerName(),name); + QString name = "static.geocode.test.plugin"; + QCOMPARE(qgeocodingmanager->managerName(),name); } -void tst_QGeoSearchManager::version() +void tst_QGeocodingManager::version() { int version=3; - QCOMPARE(qgeosearchmanager->managerVersion(),version); + QCOMPARE(qgeocodingmanager->managerVersion(),version); } -void tst_QGeoSearchManager::search() +void tst_QGeocodingManager::search() { QCOMPARE(signalerror->count(),0); QCOMPARE(signalfinished->count(),0); @@ -133,7 +133,7 @@ void tst_QGeoSearchManager::search() int offset = 2; QGeoBoundingBox *bounds = new QGeoBoundingBox (); - QGeoSearchReply * reply = qgeosearchmanager->search(search, limit,offset,bounds); + QGeocodeReply * reply = qgeocodingmanager->geocode(search, limit,offset,bounds); QCOMPARE(reply->errorString(),search); QCOMPARE(signalfinished->count(),1); @@ -144,7 +144,7 @@ void tst_QGeoSearchManager::search() } -void tst_QGeoSearchManager::geocode() +void tst_QGeocodingManager::geocode() { QCOMPARE(signalerror->count(),0); QCOMPARE(signalfinished->count(),0); @@ -155,7 +155,7 @@ void tst_QGeoSearchManager::geocode() QGeoBoundingBox *bounds = new QGeoBoundingBox (); - QGeoSearchReply *reply = qgeosearchmanager->geocode(*address,bounds); + QGeocodeReply *reply = qgeocodingmanager->geocode(*address,bounds); QCOMPARE(reply->errorString(),city); QCOMPARE(signalfinished->count(),1); @@ -166,7 +166,7 @@ void tst_QGeoSearchManager::geocode() delete reply; } -void tst_QGeoSearchManager::reverseGeocode() +void tst_QGeocodingManager::reverseGeocode() { QCOMPARE(signalerror->count(),0); QCOMPARE(signalfinished->count(),0); @@ -174,7 +174,7 @@ void tst_QGeoSearchManager::reverseGeocode() QGeoCoordinate *coordinate = new QGeoCoordinate (34.34 , 56.65); QGeoBoundingBox *bounds = new QGeoBoundingBox (); - QGeoSearchReply *reply = qgeosearchmanager->reverseGeocode(*coordinate,bounds); + QGeocodeReply *reply = qgeocodingmanager->reverseGeocode(*coordinate,bounds); QCOMPARE(reply->errorString(),coordinate->toString()); QCOMPARE(signalfinished->count(),1); @@ -188,5 +188,5 @@ void tst_QGeoSearchManager::reverseGeocode() } -QTEST_MAIN(tst_QGeoSearchManager) +QTEST_MAIN(tst_QGeocodingManager) diff --git a/tests/auto/qgeosearchmanager/tst_qgeosearchmanager.h b/tests/auto/qgeocodingmanager/tst_qgeocodingmanager.h index fc863d72..e546a5ab 100644 --- a/tests/auto/qgeosearchmanager/tst_qgeosearchmanager.h +++ b/tests/auto/qgeocodingmanager/tst_qgeocodingmanager.h @@ -41,17 +41,17 @@ //TESTED_COMPONENT=src/location -#ifndef TST_QGEOSEARCHMANAGER_H -#define TST_QGEOSEARCHMANAGER_H +#ifndef TST_QGEOCODINGMANAGER_H +#define TST_QGEOCODINGMANAGER_H #include <QLocale> #include <QtTest/QtTest> #include <QSignalSpy> #include <qgeoserviceprovider.h> -#include <qgeosearchmanager.h> +#include <qgeocodingmanager.h> #include <qlandmarkmanager.h> -#include <qgeosearchreply.h> +#include <qgeocodereply.h> #include <qgeoboundingbox.h> #include <qgeoaddress.h> #include <qgeocoordinate.h> @@ -67,7 +67,7 @@ public: QString name; }; -class tst_QGeoSearchManager: public QObject +class tst_QGeocodingManager: public QObject { Q_OBJECT @@ -86,14 +86,14 @@ private Q_SLOTS: private: QGeoServiceProvider *qgeoserviceprovider; - QGeoSearchManager *qgeosearchmanager; + QGeocodingManager *qgeocodingmanager; QSignalSpy *signalerror; QSignalSpy *signalfinished; - void loadSearchManager(); + void loadGeocodingManager(); }; -Q_DECLARE_METATYPE( QGeoSearchReply*); -Q_DECLARE_METATYPE( QGeoSearchReply::Error); +Q_DECLARE_METATYPE( QGeocodeReply*); +Q_DECLARE_METATYPE( QGeocodeReply::Error); #endif diff --git a/tests/auto/qgeosearchmanagerplugins/qgeosearchmanagerengine_test.h b/tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerengine_test.h index 32bf572a..171c2b12 100644 --- a/tests/auto/qgeosearchmanagerplugins/qgeosearchmanagerengine_test.h +++ b/tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerengine_test.h @@ -39,26 +39,26 @@ ** ****************************************************************************/ -#ifndef QGEOSEARCHMANAGERENGINE_TEST_H -#define QGEOSEARCHMANAGERENGINE_TEST_H +#ifndef QGEOCODINGMANAGERENGINE_TEST_H +#define QGEOCODINGMANAGERENGINE_TEST_H #include <qgeoserviceprovider.h> -#include <qgeosearchmanagerengine.h> +#include <qgeocodingmanagerengine.h> #include <QLocale> #include <qlandmarkmanager.h> #include <qgeoaddress.h> #include <qgeolocation.h> -#include <qgeosearchreply.h> +#include <qgeocodereply.h> QT_USE_NAMESPACE -class SearchReplyTest :public QGeoSearchReply +class GeocodeReplyTest :public QGeocodeReply { Q_OBJECT public: - SearchReplyTest(QObject *parent=0):QGeoSearchReply (parent) {} + GeocodeReplyTest(QObject *parent=0):QGeocodeReply (parent) {} void callAddLocation ( const QGeoLocation & location ) {addLocation(location);} void callSetError ( Error error, const QString & errorString ) {setError(error, errorString);} @@ -70,14 +70,14 @@ public: }; -class QGeoSearchManagerEngineTest: public QGeoSearchManagerEngine +class QGeocodingManagerEngineTest: public QGeocodingManagerEngine { Q_OBJECT public: - QGeoSearchManagerEngineTest(const QMap<QString, QVariant> ¶meters, + QGeocodingManagerEngineTest(const QMap<QString, QVariant> ¶meters, QGeoServiceProvider::Error *error, QString *errorString) : - QGeoSearchManagerEngine(parameters) + QGeocodingManagerEngine(parameters) { Q_UNUSED(error) Q_UNUSED(errorString) @@ -86,38 +86,38 @@ public: setLocale(*(new QLocale (QLocale::German, QLocale::Germany))); } - QGeoSearchReply* search ( const QString & searchString, int limit, int offset, QGeoBoundingArea * bounds ) + QGeocodeReply* geocode ( const QString & searchString, int limit, int offset, QGeoBoundingArea * bounds ) { - SearchReplyTest *searchreply = new SearchReplyTest(); - searchreply->callSetLimit(limit); - searchreply->callSetOffset(offset); - searchreply->callSetViewport(bounds); - searchreply->callSetError(QGeoSearchReply::NoError,searchString); - searchreply->callSetFinished(true); - emit(this->finished(searchreply)); - - return static_cast<QGeoSearchReply*>(searchreply); + GeocodeReplyTest *geocodereply = new GeocodeReplyTest(); + geocodereply->callSetLimit(limit); + geocodereply->callSetOffset(offset); + geocodereply->callSetViewport(bounds); + geocodereply->callSetError(QGeocodeReply::NoError,searchString); + geocodereply->callSetFinished(true); + emit(this->finished(geocodereply)); + + return static_cast<QGeocodeReply*>(geocodereply); } - QGeoSearchReply* geocode ( const QGeoAddress & address, QGeoBoundingArea * bounds ) + QGeocodeReply* geocode ( const QGeoAddress & address, QGeoBoundingArea * bounds ) { - SearchReplyTest *searchreply = new SearchReplyTest(); - searchreply->callSetViewport(bounds); - searchreply->callSetError(QGeoSearchReply::NoError,address.city()); - searchreply->callSetFinished(true); - emit(this->finished(searchreply)); + GeocodeReplyTest *geocodereply = new GeocodeReplyTest(); + geocodereply->callSetViewport(bounds); + geocodereply->callSetError(QGeocodeReply::NoError,address.city()); + geocodereply->callSetFinished(true); + emit(this->finished(geocodereply)); - return static_cast<QGeoSearchReply*>(searchreply); + return static_cast<QGeocodeReply*>(geocodereply); } - QGeoSearchReply* reverseGeocode ( const QGeoCoordinate & coordinate, QGeoBoundingArea * bounds ) + QGeocodeReply* reverseGeocode ( const QGeoCoordinate & coordinate, QGeoBoundingArea * bounds ) { - SearchReplyTest *searchreply = new SearchReplyTest(); - searchreply->callSetViewport(bounds); - searchreply->callSetError(QGeoSearchReply::NoError,coordinate.toString()); - searchreply->callSetFinished(true); - emit(this->finished(searchreply)); - return static_cast<QGeoSearchReply*>(searchreply); + GeocodeReplyTest *geocodereply = new GeocodeReplyTest(); + geocodereply->callSetViewport(bounds); + geocodereply->callSetError(QGeocodeReply::NoError,coordinate.toString()); + geocodereply->callSetFinished(true); + emit(this->finished(geocodereply)); + return static_cast<QGeocodeReply*>(geocodereply); } }; diff --git a/tests/auto/qgeosearchmanagerplugins/qgeosearchmanagerplugins.pro b/tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerplugins.pro index 5785b0f4..54897097 100644 --- a/tests/auto/qgeosearchmanagerplugins/qgeosearchmanagerplugins.pro +++ b/tests/auto/qgeocodingmanagerplugins/qgeocodingmanagerplugins.pro @@ -2,7 +2,7 @@ load(qt_module) TEMPLATE = lib CONFIG += plugin testplugin -TARGET = qtgeoservices_searchplugin +TARGET = qtgeoservices_geocodingplugin PLUGIN_TYPE=geoservices QT += location @@ -10,7 +10,7 @@ include($$QT_SOURCE_TREE/src/plugins/qpluginbase.pri) # TODO not sure where to put test plugins in Qt 5 DESTDIR = $$QT.location.plugins/geoservices -HEADERS += qgeosearchmanagerengine_test.h \ +HEADERS += qgeocodingmanagerengine_test.h \ qgeoserviceproviderplugin_test.h SOURCES += qgeoserviceproviderplugin_test.cpp diff --git a/tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.cpp b/tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.cpp index 039eaea5..5039da7c 100644 --- a/tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.cpp +++ b/tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qgeoserviceproviderplugin_test.h" -#include "qgeosearchmanagerengine_test.h" +#include "qgeocodingmanagerengine_test.h" #include <QtPlugin> @@ -54,7 +54,7 @@ QGeoServiceProviderFactoryTest::~QGeoServiceProviderFactoryTest() QString QGeoServiceProviderFactoryTest::providerName() const { - return "static.geosearch.test.plugin"; + return "static.geocode.test.plugin"; } int QGeoServiceProviderFactoryTest::providerVersion() const @@ -62,10 +62,10 @@ int QGeoServiceProviderFactoryTest::providerVersion() const return 3; } -QGeoSearchManagerEngine* QGeoServiceProviderFactoryTest::createSearchManagerEngine(const QMap< +QGeocodingManagerEngine* QGeoServiceProviderFactoryTest::createGeocodingManagerEngine(const QMap< QString, QVariant> ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const { - return new QGeoSearchManagerEngineTest(parameters, error, errorString); + return new QGeocodingManagerEngineTest(parameters, error, errorString); } -Q_EXPORT_PLUGIN2(qtgeoservices_staticsearchplugin, QGeoServiceProviderFactoryTest) +Q_EXPORT_PLUGIN2(qtgeoservices_staticgeocodingplugin, QGeoServiceProviderFactoryTest) diff --git a/tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.h b/tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.h index d1f28840..b597359d 100644 --- a/tests/auto/qgeosearchmanagerplugins/qgeoserviceproviderplugin_test.h +++ b/tests/auto/qgeocodingmanagerplugins/qgeoserviceproviderplugin_test.h @@ -58,7 +58,7 @@ public: QString providerName() const; int providerVersion() const; - QGeoSearchManagerEngine* createSearchManagerEngine(const QMap<QString, QVariant> ¶meters, + QGeocodingManagerEngine* createGeocodingManagerEngine(const QMap<QString, QVariant> ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const; }; |