diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2017-05-09 07:56:03 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2017-05-09 07:58:43 +0200 |
commit | 952d28d3453e65add5982163b56a30ff4560a894 (patch) | |
tree | 2d2d4f52309597c5d728431921f62c3b2fc9b0c4 /tests | |
parent | cc7fb64d321c4884caee0cfd29bd2de0b1b3eaeb (diff) | |
parent | c598f11461a0791d1c5fccbf328b833722207ab0 (diff) | |
download | qtlocation-952d28d3453e65add5982163b56a30ff4560a894.tar.gz |
Merge remote-tracking branch 'gerrit/5.9.0' into 5.9
Change-Id: I0cb953c2ef6d6efaf6e1c181693bd9f30432fd9a
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h | 9 | ||||
-rw-r--r-- | tests/auto/maptype/tst_maptype.cpp | 41 | ||||
-rw-r--r-- | tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp | 6 |
3 files changed, 34 insertions, 22 deletions
diff --git a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h index 94d1420a..5f6f0116 100644 --- a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h @@ -62,11 +62,12 @@ public: capabilities.setMaximumTilt(60); setTileSize(QSize(256, 256)); + const QByteArray pluginName = "qmlgeo.test.plugin"; QList<QGeoMapType> mapTypes; - mapTypes << QGeoMapType(QGeoMapType::StreetMap, tr("StreetMap"), tr("StreetMap"), false, false, 1); - mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("SatelliteMapDay"), tr("SatelliteMapDay"), false, false, 2); - mapTypes << QGeoMapType(QGeoMapType::CycleMap, tr("CycleMap"), tr("CycleMap"), false, false, 3); - mapTypes << QGeoMapType(QGeoMapType::CustomMap, tr("AlternateCameraCapabilities"), tr("AlternateCameraCapabilities"), false, false, 4); + mapTypes << QGeoMapType(QGeoMapType::StreetMap, tr("StreetMap"), tr("StreetMap"), false, false, 1, pluginName); + mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("SatelliteMapDay"), tr("SatelliteMapDay"), false, false, 2, pluginName); + mapTypes << QGeoMapType(QGeoMapType::CycleMap, tr("CycleMap"), tr("CycleMap"), false, false, 3, pluginName); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, tr("AlternateCameraCapabilities"), tr("AlternateCameraCapabilities"), false, false, 4, pluginName); setSupportedMapTypes(mapTypes); QGeoTileFetcherTest *fetcher = new QGeoTileFetcherTest(this); diff --git a/tests/auto/maptype/tst_maptype.cpp b/tests/auto/maptype/tst_maptype.cpp index 9b7956fd..43d3175c 100644 --- a/tests/auto/maptype/tst_maptype.cpp +++ b/tests/auto/maptype/tst_maptype.cpp @@ -52,8 +52,9 @@ tst_MapType::tst_MapType() {} void tst_MapType::constructorTest() { + const QByteArray pluginName = "tst_MapType"; QGeoMapType *testObjPtr = new QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street map"), - QStringLiteral("map description"), true, true, 1); + QStringLiteral("map description"), true, true, 1, pluginName); QVERIFY(testObjPtr); QCOMPARE(testObjPtr->style(), QGeoMapType::StreetMap); QCOMPARE(testObjPtr->name(), QStringLiteral("street map")); @@ -61,6 +62,7 @@ void tst_MapType::constructorTest() QVERIFY(testObjPtr->mobile()); QVERIFY(testObjPtr->night()); QCOMPARE(testObjPtr->mapId(), 1); + QCOMPARE(testObjPtr->pluginName(), pluginName); delete testObjPtr; testObjPtr = new QGeoMapType(); @@ -70,6 +72,7 @@ void tst_MapType::constructorTest() QVERIFY2(!testObjPtr->mobile(), "Wrong default value"); QVERIFY2(!testObjPtr->night(), "Wrong default value"); QCOMPARE(testObjPtr->mapId(), 0); + QCOMPARE(testObjPtr->pluginName(), QByteArrayLiteral("")); delete testObjPtr; } @@ -79,50 +82,58 @@ void tst_MapType::comparison_data() QTest::addColumn<QGeoMapType>("type2"); QTest::addColumn<bool>("expected"); + const QByteArray pluginName = "tst_MapType"; + QTest::newRow("null") << QGeoMapType() << QGeoMapType() << true; QTest::newRow("equal") << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << true; QTest::newRow("style") << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << QGeoMapType(QGeoMapType::TerrainMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << false; QTest::newRow("name") << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("different name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << false; QTest::newRow("description") << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("different desc"), false, false, 42) + QStringLiteral("different desc"), false, false, 42, pluginName) << false; QTest::newRow("mobile") << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), true, false, 42) + QStringLiteral("street desc"), true, false, 42, pluginName) << false; QTest::newRow("night") << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, true, 42) + QStringLiteral("street desc"), false, true, 42, pluginName) << false; QTest::newRow("id") << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 42) + QStringLiteral("street desc"), false, false, 42, pluginName) + << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), + QStringLiteral("street desc"), false, false, 99, pluginName) + << false; + + QTest::newRow("plugin_name") << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), + QStringLiteral("street desc"), false, false, 42, pluginName) << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("street name"), - QStringLiteral("street desc"), false, false, 99) + QStringLiteral("street desc"), false, false, 42, QByteArrayLiteral("abc")) << false; } diff --git a/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp b/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp index 1ac0abfa..0c664ba6 100644 --- a/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp +++ b/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp @@ -150,7 +150,7 @@ void tst_QGeoCameraTiles::tilesPlugin() ct.setTileSize(16); ct.setCameraData(camera); ct.setScreenSize(QSize(32, 32)); - ct.setMapType(QGeoMapType(QGeoMapType::StreetMap, "street map", "street map", false, false, 1)); + ct.setMapType(QGeoMapType(QGeoMapType::StreetMap, "street map", "street map", false, false, 1, QByteArrayLiteral(""))); QSet<QGeoTileSpec> tiles1 = ct.createTiles(); @@ -202,7 +202,7 @@ void tst_QGeoCameraTiles::tilesMapType() QSet<QGeoTileSpec> tiles1 = ct.createTiles(); - QGeoMapType mapType1 = QGeoMapType(QGeoMapType::StreetMap, "street map", "street map", false, false, 1); + QGeoMapType mapType1 = QGeoMapType(QGeoMapType::StreetMap, "street map", "street map", false, false, 1, QByteArrayLiteral("")); ct.setMapType(mapType1); QSet<QGeoTileSpec> tiles2 = ct.createTiles(); @@ -220,7 +220,7 @@ void tst_QGeoCameraTiles::tilesMapType() QCOMPARE(tiles2, tiles2_check); - QGeoMapType mapType2 = QGeoMapType(QGeoMapType::StreetMap, "satellite map", "satellite map", false, false, 2); + QGeoMapType mapType2 = QGeoMapType(QGeoMapType::StreetMap, "satellite map", "satellite map", false, false, 2, QByteArrayLiteral("")); ct.setMapType(mapType2); QSet<QGeoTileSpec> tiles3 = ct.createTiles(); |