summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-11-06 16:11:47 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-11-13 17:28:26 +0200
commitbf8b24fa8d30df374ee36be781b6a572036187b9 (patch)
treebdca15eef94898a879e4f3737eee2dc44efa275f /test
parent4e15a0c8cd7c906908d97da10f75b35a3bc2ed9e (diff)
downloadqtlocation-mapboxgl-bf8b24fa8d30df374ee36be781b6a572036187b9.tar.gz
[build] Update to geometry v1.0.0
Diffstat (limited to 'test')
-rw-r--r--test/api/annotations.test.cpp8
-rw-r--r--test/src/mbgl/test/stub_geometry_tile_feature.hpp6
-rw-r--r--test/style/filter.test.cpp6
-rw-r--r--test/tile/custom_geometry_tile.test.cpp18
-rw-r--r--test/tile/geojson_tile.test.cpp12
-rw-r--r--test/util/merge_lines.test.cpp2
6 files changed, 24 insertions, 28 deletions
diff --git a/test/api/annotations.test.cpp b/test/api/annotations.test.cpp
index fea1f87106..d13bc15ea7 100644
--- a/test/api/annotations.test.cpp
+++ b/test/api/annotations.test.cpp
@@ -359,13 +359,13 @@ TEST(Annotations, QueryRenderedFeatures) {
auto features = test.frontend.getRenderer()->queryRenderedFeatures(test.map.pixelForLatLng({ 0, 0 }));
EXPECT_EQ(features.size(), 1u);
- EXPECT_TRUE(!!features[0].id);
- EXPECT_EQ(*features[0].id, uint64_t(0));
+ EXPECT_EQ(features[0].id.is<NullValue>(), false);
+ EXPECT_EQ(features[0].id, uint64_t(0));
auto features2 = test.frontend.getRenderer()->queryRenderedFeatures(test.map.pixelForLatLng({ 50, 0 }));
EXPECT_EQ(features2.size(), 1u);
- EXPECT_TRUE(!!features2[0].id);
- EXPECT_EQ(*features2[0].id, uint64_t(1));
+ EXPECT_EQ(features[0].id.is<NullValue>(), false);
+ EXPECT_EQ(features2[0].id, uint64_t(1));
}
TEST(Annotations, QueryFractionalZoomLevels) {
diff --git a/test/src/mbgl/test/stub_geometry_tile_feature.hpp b/test/src/mbgl/test/stub_geometry_tile_feature.hpp
index 0164ab133c..ef21f8e937 100644
--- a/test/src/mbgl/test/stub_geometry_tile_feature.hpp
+++ b/test/src/mbgl/test/stub_geometry_tile_feature.hpp
@@ -9,7 +9,7 @@ public:
: properties(std::move(properties_)) {
}
- StubGeometryTileFeature(optional<FeatureIdentifier> id_, FeatureType type_, GeometryCollection geometry_, PropertyMap properties_)
+ StubGeometryTileFeature(FeatureIdentifier id_, FeatureType type_, GeometryCollection geometry_, PropertyMap properties_)
: properties(std::move(properties_)),
id(std::move(id_)),
type(type_),
@@ -17,7 +17,7 @@ public:
}
PropertyMap properties;
- optional<FeatureIdentifier> id;
+ FeatureIdentifier id;
FeatureType type = FeatureType::Point;
GeometryCollection geometry;
@@ -25,7 +25,7 @@ public:
return type;
}
- optional<FeatureIdentifier> getID() const override {
+ FeatureIdentifier getID() const override {
return id;
}
diff --git a/test/style/filter.test.cpp b/test/style/filter.test.cpp
index 9678fe0895..ef38a1a789 100644
--- a/test/style/filter.test.cpp
+++ b/test/style/filter.test.cpp
@@ -21,7 +21,7 @@ using namespace mbgl::style;
bool filter(const char * json,
const PropertyMap& featureProperties = {{}},
- optional<FeatureIdentifier> featureId = {},
+ FeatureIdentifier featureId = {},
FeatureType featureType = FeatureType::Point,
GeometryCollection featureGeometry = {},
float zoom = 0.0f) {
@@ -81,7 +81,7 @@ std::string stringifyFilter(const char * json) {
TEST(Filter, EqualsNull) {
auto f = R"(["==", "foo", null])";
- ASSERT_TRUE(filter(f, {{ "foo", mapbox::geometry::null_value }}));
+ ASSERT_TRUE(filter(f, {{ "foo", mapbox::feature::null_value }}));
ASSERT_FALSE(filter(f, {{ "foo", int64_t(0) }}));
ASSERT_FALSE(filter(f, {{ "foo", int64_t(1) }}));
@@ -107,7 +107,7 @@ TEST(Filter, EqualsNumber) {
ASSERT_FALSE(filter(f, {{ "foo", std::string("0") }}));
ASSERT_FALSE(filter(f, {{ "foo", false }}));
ASSERT_FALSE(filter(f, {{ "foo", true }}));
- ASSERT_FALSE(filter(f, {{ "foo", mapbox::geometry::null_value }}));
+ ASSERT_FALSE(filter(f, {{ "foo", mapbox::feature::null_value }}));
ASSERT_FALSE(filter(f, {{}}));
}
diff --git a/test/tile/custom_geometry_tile.test.cpp b/test/tile/custom_geometry_tile.test.cpp
index 21a3dd7953..dc6aaab1ac 100644
--- a/test/tile/custom_geometry_tile.test.cpp
+++ b/test/tile/custom_geometry_tile.test.cpp
@@ -50,8 +50,8 @@ TEST(CustomGeometryTile, InvokeFetchTile) {
CircleLayer layer("circle", "source");
- mapbox::geometry::feature_collection<double> features;
- features.push_back(mapbox::geometry::feature<double> {
+ mapbox::feature::feature_collection<double> features;
+ features.push_back(mapbox::feature::feature<double> {
mapbox::geometry::point<double>(0, 0)
});
CustomTileLoader loader([&](const CanonicalTileID& tileId) {
@@ -62,7 +62,7 @@ TEST(CustomGeometryTile, InvokeFetchTile) {
});
auto mb =std::make_shared<Mailbox>(*Scheduler::GetCurrent());
ActorRef<CustomTileLoader> loaderActor(loader, mb);
-
+
CustomGeometryTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, CustomGeometrySource::TileOptions(),
loaderActor);
@@ -76,8 +76,8 @@ TEST(CustomGeometryTile, InvokeCancelTile) {
CircleLayer layer("circle", "source");
- mapbox::geometry::feature_collection<double> features;
- features.push_back(mapbox::geometry::feature<double> {
+ mapbox::feature::feature_collection<double> features;
+ features.push_back(mapbox::feature::feature<double> {
mapbox::geometry::point<double>(0, 0)
});
@@ -87,7 +87,7 @@ TEST(CustomGeometryTile, InvokeCancelTile) {
});
auto mb =std::make_shared<Mailbox>(*Scheduler::GetCurrent());
ActorRef<CustomTileLoader> loaderActor(loader, mb);
-
+
CustomGeometryTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, CustomGeometrySource::TileOptions(),
loaderActor);
@@ -101,15 +101,15 @@ TEST(CustomGeometryTile, InvokeTileChanged) {
CircleLayer layer("circle", "source");
- mapbox::geometry::feature_collection<double> features;
- features.push_back(mapbox::geometry::feature<double> {
+ mapbox::feature::feature_collection<double> features;
+ features.push_back(mapbox::feature::feature<double> {
mapbox::geometry::point<double>(0, 0)
});
CustomTileLoader loader(nullptr, nullptr);
auto mb =std::make_shared<Mailbox>(*Scheduler::GetCurrent());
ActorRef<CustomTileLoader> loaderActor(loader, mb);
-
+
CustomGeometryTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, CustomGeometrySource::TileOptions(),
loaderActor);
diff --git a/test/tile/geojson_tile.test.cpp b/test/tile/geojson_tile.test.cpp
index c05e04bc8d..fb5f3ca6d7 100644
--- a/test/tile/geojson_tile.test.cpp
+++ b/test/tile/geojson_tile.test.cpp
@@ -50,10 +50,8 @@ TEST(GeoJSONTile, Issue7648) {
CircleLayer layer("circle", "source");
- mapbox::geometry::feature_collection<int16_t> features;
- features.push_back(mapbox::geometry::feature<int16_t> {
- mapbox::geometry::point<int16_t>(0, 0)
- });
+ mapbox::feature::feature_collection<int16_t> features;
+ features.push_back(mapbox::feature::feature<int16_t> { mapbox::geometry::point<int16_t>(0, 0) });
GeoJSONTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, features);
@@ -84,10 +82,8 @@ TEST(GeoJSONTile, Issue9927) {
CircleLayer layer("circle", "source");
- mapbox::geometry::feature_collection<int16_t> features;
- features.push_back(mapbox::geometry::feature<int16_t> {
- mapbox::geometry::point<int16_t>(0, 0)
- });
+ mapbox::feature::feature_collection<int16_t> features;
+ features.push_back(mapbox::feature::feature<int16_t> { mapbox::geometry::point<int16_t>(0, 0) });
GeoJSONTile tile(OverscaledTileID(0, 0, 0), "source", test.tileParameters, features);
diff --git a/test/util/merge_lines.test.cpp b/test/util/merge_lines.test.cpp
index 032a09ba21..f76a1ea72a 100644
--- a/test/util/merge_lines.test.cpp
+++ b/test/util/merge_lines.test.cpp
@@ -19,7 +19,7 @@ LineString<int16_t> emptyLine;
class SymbolFeatureStub : public SymbolFeature {
public:
- SymbolFeatureStub(optional<FeatureIdentifier> id_, FeatureType type_, GeometryCollection geometry_,
+ SymbolFeatureStub(FeatureIdentifier id_, FeatureType type_, GeometryCollection geometry_,
PropertyMap properties_, optional<std::u16string> text_,
optional<std::string> icon_, std::size_t index_) :
SymbolFeature(std::make_unique<StubGeometryTileFeature>(std::move(id_), type_, std::move(geometry_), std::move(properties_)))