diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2021-03-26 15:56:25 +0100 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2021-05-12 09:45:49 +0200 |
commit | 72d445140eef10f0d655d688f4f65d47d2261c50 (patch) | |
tree | 2245a4a50142ca5c6ae2d85c2bdbdf6de97a51d2 /tests/auto | |
parent | 3851559a2571a494a8b43ca9055e620e8a3ec805 (diff) | |
download | qtlocation-72d445140eef10f0d655d688f4f65d47d2261c50.tar.gz |
QGeoPositionInfoSource: add property bindings
Also introduced a couple of documentation fixes
Task-number: QTBUG-89874
Change-Id: Icb902784378cf2847c6a5dab23dbf1acbb228e8a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests/auto')
9 files changed, 39 insertions, 13 deletions
diff --git a/tests/auto/qgeopositioninfosource/CMakeLists.txt b/tests/auto/qgeopositioninfosource/CMakeLists.txt index 37410037..361b69e7 100644 --- a/tests/auto/qgeopositioninfosource/CMakeLists.txt +++ b/tests/auto/qgeopositioninfosource/CMakeLists.txt @@ -9,9 +9,10 @@ qt_internal_add_test(tst_qgeopositioninfosource ../utils/qlocationtestutils.cpp ../utils/qlocationtestutils_p.h testqgeopositioninfosource.cpp testqgeopositioninfosource_p.h tst_qgeopositioninfosource.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Core Qt::Positioning + Qt::TestPrivate ) #### Keys ignored in scope 1:.:.:qgeopositioninfosource.pro:<TRUE>: diff --git a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp index 283ac4ca..2ff65491 100644 --- a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp +++ b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource.cpp @@ -26,9 +26,6 @@ ** ****************************************************************************/ -//TESTED_COMPONENT=src/location - -#include <QTest> #include <QMetaType> #include <QSignalSpy> #include <QDebug> @@ -783,4 +780,28 @@ void TestQGeoPositionInfoSource::removeSlotForPositionUpdated() QTRY_VERIFY_WITH_TIMEOUT((m_testSlot2Called == true), 7000); } +void TestQGeoPositionInfoSource::updateIntervalBinding() +{ + auto parent = std::make_unique<QObject>(); + // source will be deleted when parent goes out of scope + QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(parent.get()); + QVERIFY(source != nullptr); + + QTestPrivate::testReadWritePropertyBasics<QGeoPositionInfoSource, int>(*source, 1000, 2000, + "updateInterval"); +} + +void TestQGeoPositionInfoSource::preferredMethodsBinding() +{ + auto parent = std::make_unique<QObject>(); + // source will be deleted when parent goes out of scope + QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(parent.get()); + QVERIFY(source != nullptr); + + QTestPrivate::testReadWritePropertyBasics<QGeoPositionInfoSource, + QGeoPositionInfoSource::PositioningMethods>( + *source, QGeoPositionInfoSource::SatellitePositioningMethods, + QGeoPositionInfoSource::AllPositioningMethods, "preferredPositioningMethods"); +} + #include "testqgeopositioninfosource.moc" diff --git a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource_p.h b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource_p.h index 7ee23f8b..382971fa 100644 --- a/tests/auto/qgeopositioninfosource/testqgeopositioninfosource_p.h +++ b/tests/auto/qgeopositioninfosource/testqgeopositioninfosource_p.h @@ -29,14 +29,13 @@ #ifndef TESTQGEOPOSITIONINFOSOURCE_P_H #define TESTQGEOPOSITIONINFOSOURCE_P_H -#include <QtPositioning/qgeopositioninfosource.h> - #ifdef TST_GEOCLUEMOCK_ENABLED #include "geocluemock.h" #include <QThread> #endif #include <QTest> +#include <QtTest/private/qpropertytesthelper_p.h> #include <QObject> QT_BEGIN_NAMESPACE @@ -118,6 +117,9 @@ private slots: void removeSlotForRequestTimeout(); void removeSlotForPositionUpdated(); + void updateIntervalBinding(); + void preferredMethodsBinding(); + private: QGeoPositionInfoSource *m_source; bool m_testingDefaultSource; diff --git a/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/CMakeLists.txt b/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/CMakeLists.txt index 70efdddf..d152dc72 100644 --- a/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/CMakeLists.txt +++ b/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/CMakeLists.txt @@ -6,7 +6,6 @@ qt_internal_add_test(tst_dummynmeapositioninfosource SOURCES - ../../qgeopositioninfosource/testqgeopositioninfosource.cpp ../../qgeopositioninfosource/testqgeopositioninfosource_p.h ../../utils/qlocationtestutils.cpp ../../utils/qlocationtestutils_p.h ../../utils/qnmeaproxyfactory.cpp ../../utils/qnmeaproxyfactory.h tst_dummynmeapositioninfosource.cpp @@ -14,7 +13,7 @@ qt_internal_add_test(tst_dummynmeapositioninfosource QT_DISABLE_DEPRECATED_BEFORE=0 INCLUDE_DIRECTORIES .. - PUBLIC_LIBRARIES + LIBRARIES Qt::Core Qt::Network Qt::Positioning diff --git a/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp b/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp index d6e1aaba..70059550 100644 --- a/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp +++ b/tests/auto/qnmeapositioninfosource/dummynmeapositioninfosource/tst_dummynmeapositioninfosource.cpp @@ -29,7 +29,6 @@ //TESTED_COMPONENT=src/location #include "../utils/qnmeaproxyfactory.h" -#include "../qgeopositioninfosource/testqgeopositioninfosource_p.h" #include "../utils/qlocationtestutils_p.h" #include <QtPositioning/qnmeapositioninfosource.h> diff --git a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime/CMakeLists.txt b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime/CMakeLists.txt index ba053cc6..4ca5f9a2 100644 --- a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime/CMakeLists.txt +++ b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime/CMakeLists.txt @@ -15,10 +15,11 @@ qt_internal_add_test(tst_qnmeapositioninfosource_realtime QT_DISABLE_DEPRECATED_BEFORE=0 INCLUDE_DIRECTORIES .. - PUBLIC_LIBRARIES + LIBRARIES Qt::Core Qt::Network Qt::Positioning + Qt::TestPrivate ) #### Keys ignored in scope 1:.:.:qnmeapositioninfosource_realtime.pro:<TRUE>: diff --git a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/CMakeLists.txt b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/CMakeLists.txt index e50abb7e..d7f2bfdd 100644 --- a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/CMakeLists.txt +++ b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_realtime_generic/CMakeLists.txt @@ -15,10 +15,11 @@ qt_internal_add_test(tst_qnmeapositioninfosource_realtime_generic QT_DISABLE_DEPRECATED_BEFORE=0 INCLUDE_DIRECTORIES .. - PUBLIC_LIBRARIES + LIBRARIES Qt::Core Qt::Network Qt::Positioning + Qt::TestPrivate ) #### Keys ignored in scope 1:.:.:qnmeapositioninfosource_realtime_generic.pro:<TRUE>: diff --git a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation/CMakeLists.txt b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation/CMakeLists.txt index 084c6494..f0ea5cec 100644 --- a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation/CMakeLists.txt +++ b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation/CMakeLists.txt @@ -15,10 +15,11 @@ qt_internal_add_test(tst_qnmeapositioninfosource_simulation QT_DISABLE_DEPRECATED_BEFORE=0 INCLUDE_DIRECTORIES .. - PUBLIC_LIBRARIES + LIBRARIES Qt::Core Qt::Network Qt::Positioning + Qt::TestPrivate ) #### Keys ignored in scope 1:.:.:qnmeapositioninfosource_simulation.pro:<TRUE>: diff --git a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/CMakeLists.txt b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/CMakeLists.txt index 16e84527..9232f9a8 100644 --- a/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/CMakeLists.txt +++ b/tests/auto/qnmeapositioninfosource/qnmeapositioninfosource_simulation_generic/CMakeLists.txt @@ -20,10 +20,11 @@ qt_internal_add_test(tst_qnmeaposinfosource_sim_generic QT_DISABLE_DEPRECATED_BEFORE=0 INCLUDE_DIRECTORIES .. - PUBLIC_LIBRARIES + LIBRARIES Qt::Core Qt::Network Qt::Positioning + Qt::TestPrivate ) #### Keys ignored in scope 1:.:.:qnmeapositioninfosource_simulation_generic.pro:<TRUE>: |