diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-07-11 19:19:04 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-07-12 20:42:29 +0300 |
commit | 4014aa6721e53318e4ac92814776b3e01b4589cb (patch) | |
tree | dd57dfb64f5db1a9afaf7ab94cfa9aaeaae1392b | |
parent | 2fae373fc9da1a5ed61b5114d8c982073734826d (diff) | |
download | qtlocation-mapboxgl-4014aa6721e53318e4ac92814776b3e01b4589cb.tar.gz |
[core] GCC 4.9 bracket initialization issues
-rw-r--r-- | include/mbgl/map/map.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/style/transition_options.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/util/convert.hpp | 2 | ||||
-rw-r--r-- | platform/qt/app/mapwindow.cpp | 22 | ||||
-rw-r--r-- | src/mbgl/annotation/fill_annotation_impl.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/annotation/line_annotation_impl.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/gl/uniform.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/map/map.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/sources/render_image_source.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/sources/render_raster_source.cpp | 4 | ||||
-rw-r--r-- | test/gl/bucket.test.cpp | 16 | ||||
-rw-r--r-- | test/src/mbgl/test/stub_geometry_tile_feature.hpp | 4 | ||||
-rw-r--r-- | test/style/function/source_function.test.cpp | 9 | ||||
-rw-r--r-- | test/tile/annotation_tile.test.cpp | 6 | ||||
-rw-r--r-- | test/tile/vector_tile.test.cpp | 2 | ||||
-rw-r--r-- | test/util/merge_lines.test.cpp | 73 |
16 files changed, 93 insertions, 65 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index 158e9d733d..d82a260362 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -41,7 +41,7 @@ public: GLContextMode contextMode = GLContextMode::Unique, ConstrainMode constrainMode = ConstrainMode::HeightOnly, ViewportMode viewportMode = ViewportMode::Default, - const optional<std::string>& programCacheDir = {}); + optional<std::string> programCacheDir = optional<std::string>()); ~Map(); // Register a callback that will get called (on the render thread) when all resources have diff --git a/include/mbgl/style/transition_options.hpp b/include/mbgl/style/transition_options.hpp index 6dad17aeb4..0ac7c02c6b 100644 --- a/include/mbgl/style/transition_options.hpp +++ b/include/mbgl/style/transition_options.hpp @@ -8,8 +8,8 @@ namespace style { class TransitionOptions { public: - optional<Duration> duration = {}; - optional<Duration> delay = {}; + optional<Duration> duration; + optional<Duration> delay; TransitionOptions(optional<Duration> duration_ = optional<Duration>(), optional<Duration> delay_ = optional<Duration>()) diff --git a/include/mbgl/util/convert.hpp b/include/mbgl/util/convert.hpp index bedb1a4a08..02ec7feef9 100644 --- a/include/mbgl/util/convert.hpp +++ b/include/mbgl/util/convert.hpp @@ -10,7 +10,7 @@ namespace util { template<typename To, typename From, std::size_t Size, typename = std::enable_if_t<std::is_convertible<From, To>::value>> MBGL_CONSTEXPR std::array<To, Size> convert(const std::array<From, Size>&from) { - std::array<To, Size> to {}; + std::array<To, Size> to {{}}; std::copy(std::begin(from), std::end(from), std::begin(to)); return to; } diff --git a/platform/qt/app/mapwindow.cpp b/platform/qt/app/mapwindow.cpp index 03ca052ec4..c4efbfa318 100644 --- a/platform/qt/app/mapwindow.cpp +++ b/platform/qt/app/mapwindow.cpp @@ -254,8 +254,13 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) if (m_lineAnnotationId.isNull()) { QMapbox::Coordinate topLeft = m_map->coordinateForPixel({ 0, 0 }); QMapbox::Coordinate bottomRight = m_map->coordinateForPixel({ qreal(size().width()), qreal(size().height()) }); - QMapbox::CoordinatesCollections geometry { { { topLeft, bottomRight } } }; - QMapbox::LineAnnotation line { { QMapbox::ShapeAnnotationGeometry::LineStringType, geometry }, 0.5f, 1.0f, Qt::red }; + QMapbox::CoordinatesCollections lineGeometry { { { topLeft, bottomRight } } }; + QMapbox::ShapeAnnotationGeometry annotationGeometry { QMapbox::ShapeAnnotationGeometry::LineStringType, lineGeometry }; + QMapbox::LineAnnotation line; + line.geometry = annotationGeometry; + line.opacity = 0.5f; + line.width = 1.0f; + line.color = Qt::red; m_lineAnnotationId = m_map->addAnnotation(QVariant::fromValue<QMapbox::LineAnnotation>(line)); } else { m_map->removeAnnotation(m_lineAnnotationId.toUInt()); @@ -269,8 +274,13 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) QMapbox::Coordinate topRight = m_map->coordinateForPixel({ 0, qreal(size().height()) }); QMapbox::Coordinate bottomLeft = m_map->coordinateForPixel({ qreal(size().width()), 0 }); QMapbox::Coordinate bottomRight = m_map->coordinateForPixel({ qreal(size().width()), qreal(size().height()) }); - QMapbox::CoordinatesCollections geometry { { { bottomLeft, bottomRight, topRight, topLeft, bottomLeft } } }; - QMapbox::FillAnnotation fill { { QMapbox::ShapeAnnotationGeometry::PolygonType, geometry }, 0.5f, Qt::green, QVariant::fromValue<QColor>(QColor(Qt::black)) }; + QMapbox::CoordinatesCollections fillGeometry { { { bottomLeft, bottomRight, topRight, topLeft, bottomLeft } } }; + QMapbox::ShapeAnnotationGeometry annotationGeometry { QMapbox::ShapeAnnotationGeometry::PolygonType, fillGeometry }; + QMapbox::FillAnnotation fill; + fill.geometry = annotationGeometry; + fill.opacity = 0.5f; + fill.color = Qt::green; + fill.outlineColor = QVariant::fromValue<QColor>(QColor(Qt::black)); m_fillAnnotationId = m_map->addAnnotation(QVariant::fromValue<QMapbox::FillAnnotation>(fill)); } else { m_map->removeAnnotation(m_fillAnnotationId.toUInt()); @@ -283,8 +293,8 @@ void MapWindow::keyPressEvent(QKeyEvent *ev) m_map->removeLayer("circleLayer"); m_map->removeSource("circleSource"); } else { - QMapbox::CoordinatesCollections geometry { { { m_map->coordinate() } } }; - QMapbox::Feature feature { QMapbox::Feature::PointType, geometry, {}, {} }; + QMapbox::CoordinatesCollections point { { { m_map->coordinate() } } }; + QMapbox::Feature feature { QMapbox::Feature::PointType, point, {}, {} }; QVariantMap circleSource; circleSource["type"] = "geojson"; diff --git a/src/mbgl/annotation/fill_annotation_impl.cpp b/src/mbgl/annotation/fill_annotation_impl.cpp index 5dc36edab0..9c73aeb796 100644 --- a/src/mbgl/annotation/fill_annotation_impl.cpp +++ b/src/mbgl/annotation/fill_annotation_impl.cpp @@ -9,7 +9,7 @@ using namespace style; FillAnnotationImpl::FillAnnotationImpl(AnnotationID id_, FillAnnotation annotation_, uint8_t maxZoom_) : ShapeAnnotationImpl(id_, maxZoom_), - annotation({ ShapeAnnotationGeometry::visit(annotation_.geometry, CloseShapeAnnotation{}), annotation_.opacity, annotation_.color, annotation_.outlineColor }) { + annotation(ShapeAnnotationGeometry::visit(annotation_.geometry, CloseShapeAnnotation{}), annotation_.opacity, annotation_.color, annotation_.outlineColor) { } void FillAnnotationImpl::updateStyle(Style::Impl& style) const { diff --git a/src/mbgl/annotation/line_annotation_impl.cpp b/src/mbgl/annotation/line_annotation_impl.cpp index 8954ecfa58..d35b956888 100644 --- a/src/mbgl/annotation/line_annotation_impl.cpp +++ b/src/mbgl/annotation/line_annotation_impl.cpp @@ -9,7 +9,7 @@ using namespace style; LineAnnotationImpl::LineAnnotationImpl(AnnotationID id_, LineAnnotation annotation_, uint8_t maxZoom_) : ShapeAnnotationImpl(id_, maxZoom_), - annotation({ ShapeAnnotationGeometry::visit(annotation_.geometry, CloseShapeAnnotation{}), annotation_.opacity, annotation_.width, annotation_.color }) { + annotation(ShapeAnnotationGeometry::visit(annotation_.geometry, CloseShapeAnnotation{}), annotation_.opacity, annotation_.width, annotation_.color) { } void LineAnnotationImpl::updateStyle(Style::Impl& style) const { diff --git a/src/mbgl/gl/uniform.hpp b/src/mbgl/gl/uniform.hpp index 829192bcca..4ed2419764 100644 --- a/src/mbgl/gl/uniform.hpp +++ b/src/mbgl/gl/uniform.hpp @@ -48,6 +48,8 @@ public: class State { public: + State(UniformLocation location_) : location(std::move(location_)) {} + void operator=(const Value& value) { if (location >= 0 && (!current || *current != value.t)) { current = value.t; @@ -106,7 +108,7 @@ public: template <class Program> static State loadNamedLocations(const Program& program) { - return State{ { program.uniformLocation(Us::name()) }... }; + return State(typename Us::State(program.uniformLocation(Us::name()))...); } static NamedLocations getNamedLocations(const State& state) { diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 565d39c515..26795f7814 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -111,7 +111,7 @@ Map::Map(Backend& backend, GLContextMode contextMode, ConstrainMode constrainMode, ViewportMode viewportMode, - const optional<std::string>& programCacheDir) + optional<std::string> programCacheDir) : impl(std::make_unique<Impl>(*this, backend, pixelRatio, diff --git a/src/mbgl/renderer/sources/render_image_source.cpp b/src/mbgl/renderer/sources/render_image_source.cpp index f5068b9d7f..6a3cb33fec 100644 --- a/src/mbgl/renderer/sources/render_image_source.cpp +++ b/src/mbgl/renderer/sources/render_image_source.cpp @@ -60,11 +60,11 @@ RenderImageSource::queryRenderedFeatures(const ScreenLineString&, const TransformState&, const RenderStyle&, const RenderedQueryOptions&) const { - return {}; + return std::unordered_map<std::string, std::vector<Feature>>(); } std::vector<Feature> RenderImageSource::querySourceFeatures(const SourceQueryOptions&) const { - return {}; + return std::vector<Feature>(); } void RenderImageSource::update(Immutable<style::Source::Impl> baseImpl_, diff --git a/src/mbgl/renderer/sources/render_raster_source.cpp b/src/mbgl/renderer/sources/render_raster_source.cpp index 2006e31628..6bf9caa1b4 100644 --- a/src/mbgl/renderer/sources/render_raster_source.cpp +++ b/src/mbgl/renderer/sources/render_raster_source.cpp @@ -73,11 +73,11 @@ RenderRasterSource::queryRenderedFeatures(const ScreenLineString&, const TransformState&, const RenderStyle&, const RenderedQueryOptions&) const { - return {}; + return std::unordered_map<std::string, std::vector<Feature>>(); } std::vector<Feature> RenderRasterSource::querySourceFeatures(const SourceQueryOptions&) const { - return {}; + return std::vector<Feature>(); } void RenderRasterSource::onLowMemory() { diff --git a/test/gl/bucket.test.cpp b/test/gl/bucket.test.cpp index fdff0e990a..24bec0bd22 100644 --- a/test/gl/bucket.test.cpp +++ b/test/gl/bucket.test.cpp @@ -14,6 +14,12 @@ using namespace mbgl; +namespace { + +PropertyMap properties; + +} // namespace + TEST(Buckets, CircleBucket) { gl::Context context; CircleBucket bucket { { {0, 0, 0}, MapMode::Still, 1.0 }, {} }; @@ -21,7 +27,7 @@ TEST(Buckets, CircleBucket) { ASSERT_FALSE(bucket.needsUpload()); GeometryCollection point { { { 0, 0 } } }; - bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, {} }, point); + bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point); ASSERT_TRUE(bucket.hasData()); ASSERT_TRUE(bucket.needsUpload()); @@ -37,7 +43,7 @@ TEST(Buckets, FillBucket) { ASSERT_FALSE(bucket.needsUpload()); GeometryCollection polygon { { { 0, 0 }, { 0, 1 }, { 1, 1 } } }; - bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Polygon, polygon, {} }, polygon); + bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Polygon, polygon, properties }, polygon); ASSERT_TRUE(bucket.hasData()); ASSERT_TRUE(bucket.needsUpload()); @@ -53,11 +59,11 @@ TEST(Buckets, LineBucket) { // Ignore invalid feature type. GeometryCollection point { { { 0, 0 } } }; - bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, {} }, point); + bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point); ASSERT_FALSE(bucket.hasData()); GeometryCollection line { { { 0, 0 }, { 1, 1 } } }; - bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::LineString, line, {} }, line); + bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::LineString, line, properties }, line); ASSERT_TRUE(bucket.hasData()); ASSERT_TRUE(bucket.needsUpload()); @@ -80,7 +86,7 @@ TEST(Buckets, SymbolBucket) { // SymbolBucket::addFeature() is a no-op. GeometryCollection point { { { 0, 0 } } }; - bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, {} }, point); + bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point); ASSERT_FALSE(bucket.hasData()); ASSERT_FALSE(bucket.needsUpload()); diff --git a/test/src/mbgl/test/stub_geometry_tile_feature.hpp b/test/src/mbgl/test/stub_geometry_tile_feature.hpp index 775d783ead..0164ab133c 100644 --- a/test/src/mbgl/test/stub_geometry_tile_feature.hpp +++ b/test/src/mbgl/test/stub_geometry_tile_feature.hpp @@ -17,9 +17,9 @@ public: } PropertyMap properties; - optional<FeatureIdentifier> id = {}; + optional<FeatureIdentifier> id; FeatureType type = FeatureType::Point; - GeometryCollection geometry = {}; + GeometryCollection geometry; FeatureType getType() const override { return type; diff --git a/test/style/function/source_function.test.cpp b/test/style/function/source_function.test.cpp index 260620c8d0..46ad961002 100644 --- a/test/style/function/source_function.test.cpp +++ b/test/style/function/source_function.test.cpp @@ -76,11 +76,14 @@ TEST(SourceFunction, Categorical) { EXPECT_EQ(0.0f, SourceFunction<float>("property", CategoricalStops<float>({{ int64_t(1), 1.0f }})) .evaluate(oneString, 0.0f)); - EXPECT_EQ(0.0f, SourceFunction<float>("property", CategoricalStops<float>({{ "1"s, 1.0f }})) + CategoricalStops<float>::Stops stops; + stops["1"s] = 1.0f; + + EXPECT_EQ(0.0f, SourceFunction<float>("property", CategoricalStops<float>(stops)) .evaluate(oneInteger, 0.0f)); - EXPECT_EQ(0.0f, SourceFunction<float>("property", CategoricalStops<float>({{ "1"s, 1.0f }})) + EXPECT_EQ(0.0f, SourceFunction<float>("property", CategoricalStops<float>(stops)) .evaluate(oneDouble, 0.0f)); - EXPECT_EQ(1.0f, SourceFunction<float>("property", CategoricalStops<float>({{ "1"s, 1.0f }})) + EXPECT_EQ(1.0f, SourceFunction<float>("property", CategoricalStops<float>(stops)) .evaluate(oneString, 0.0f)); EXPECT_EQ(1.0f, SourceFunction<float>("property", CategoricalStops<float>({{ true, 1.0f }})) diff --git a/test/tile/annotation_tile.test.cpp b/test/tile/annotation_tile.test.cpp index a1bfc23492..813b813220 100644 --- a/test/tile/annotation_tile.test.cpp +++ b/test/tile/annotation_tile.test.cpp @@ -58,7 +58,7 @@ TEST(AnnotationTile, Issue8289) { // Simulate layout and placement of a symbol layer. tile.onLayout(GeometryTile::LayoutResult { - {}, + std::unordered_map<std::string, std::shared_ptr<Bucket>>(), std::make_unique<FeatureIndex>(), std::move(data), 0 @@ -72,7 +72,7 @@ TEST(AnnotationTile, Issue8289) { collisionTile->placeFeature(feature, false, false); tile.onPlacement(GeometryTile::PlacementResult { - {}, + std::unordered_map<std::string, std::shared_ptr<Bucket>>(), std::move(collisionTile), {}, {}, @@ -81,7 +81,7 @@ TEST(AnnotationTile, Issue8289) { // Simulate a second layout with empty data. tile.onLayout(GeometryTile::LayoutResult { - {}, + std::unordered_map<std::string, std::shared_ptr<Bucket>>(), std::make_unique<FeatureIndex>(), std::make_unique<AnnotationTileData>(), 0 diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp index 18152cd2c1..d7ad3c999d 100644 --- a/test/tile/vector_tile.test.cpp +++ b/test/tile/vector_tile.test.cpp @@ -89,7 +89,7 @@ TEST(VectorTile, Issue7615) { // Subsequent onLayout should not cause the existing symbol bucket to be discarded. tile.onLayout(GeometryTile::LayoutResult { - {}, + std::unordered_map<std::string, std::shared_ptr<Bucket>>(), nullptr, nullptr, 0 diff --git a/test/util/merge_lines.test.cpp b/test/util/merge_lines.test.cpp index ff80157354..d3a2ebae03 100644 --- a/test/util/merge_lines.test.cpp +++ b/test/util/merge_lines.test.cpp @@ -10,15 +10,22 @@ const std::u16string bbb = u"b"; using namespace mbgl; +namespace { + +PropertyMap properties; +LineString<int16_t> emptyLine; + +} + class SymbolFeatureStub : public SymbolFeature { public: SymbolFeatureStub(optional<FeatureIdentifier> id_, FeatureType type_, GeometryCollection geometry_, - std::unordered_map<std::string, Value> properties_, optional<std::u16string> text_, - optional<std::string> icon_, std::size_t index_) : - SymbolFeature(std::make_unique<StubGeometryTileFeature>(id_, type_, geometry_, properties_)) + 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_))) { - text = text_; - icon = icon_; + text = std::move(text_); + icon = std::move(icon_); index = index_; } }; @@ -26,20 +33,20 @@ public: TEST(MergeLines, SameText) { // merges lines with the same text std::vector<mbgl::SymbolFeature> input1; - input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}}}, {}, aaa, {}, 0)); - input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{4, 0}, {5, 0}, {6, 0}}}, {}, bbb, {}, 0)); - input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{8, 0}, {9, 0}}}, {}, aaa, {}, 0)); - input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{2, 0}, {3, 0}, {4, 0}}}, {}, aaa, {}, 0)); - input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{6, 0}, {7, 0}, {8, 0}}}, {}, aaa, {}, 0)); - input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{5, 0}, {6, 0}}}, {}, aaa, {}, 0)); + input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}}}, properties, aaa, {}, 0)); + input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{4, 0}, {5, 0}, {6, 0}}}, properties, bbb, {}, 0)); + input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{8, 0}, {9, 0}}}, properties, aaa, {}, 0)); + input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{2, 0}, {3, 0}, {4, 0}}}, properties, aaa, {}, 0)); + input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{6, 0}, {7, 0}, {8, 0}}}, properties, aaa, {}, 0)); + input1.push_back(SymbolFeatureStub({}, FeatureType::LineString, {{{5, 0}, {6, 0}}}, properties, aaa, {}, 0)); const std::vector<StubGeometryTileFeature> expected1 = { - { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}}, {} }, - { {}, FeatureType::LineString, {{{4, 0}, {5, 0}, {6, 0}}}, {} }, - { {}, FeatureType::LineString, {{{5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}}, {} }, - { {}, FeatureType::LineString, {{}}, {} }, - { {}, FeatureType::LineString, {{}}, {} }, - { {}, FeatureType::LineString, {{}}, {} } + { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}}, properties }, + { {}, FeatureType::LineString, {{{4, 0}, {5, 0}, {6, 0}}}, properties }, + { {}, FeatureType::LineString, {{{5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}}, properties }, + { {}, FeatureType::LineString, { emptyLine }, properties }, + { {}, FeatureType::LineString, { emptyLine }, properties }, + { {}, FeatureType::LineString, { emptyLine }, properties } }; mbgl::util::mergeLines(input1); @@ -52,14 +59,14 @@ TEST(MergeLines, SameText) { TEST(MergeLines, BothEnds) { // mergeLines handles merge from both ends std::vector<mbgl::SymbolFeature> input2; - input2.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}}}, {}, aaa, {}, 0 }); - input2.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{4, 0}, {5, 0}, {6, 0}}}, {}, aaa, {}, 0 }); - input2.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{2, 0}, {3, 0}, {4, 0}}}, {}, aaa, {}, 0 }); + input2.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}}}, properties, aaa, {}, 0 }); + input2.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{4, 0}, {5, 0}, {6, 0}}}, properties, aaa, {}, 0 }); + input2.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{2, 0}, {3, 0}, {4, 0}}}, properties, aaa, {}, 0 }); const std::vector<StubGeometryTileFeature> expected2 = { - { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}}, {} }, - { {}, FeatureType::LineString, {{}}, {} }, - { {}, FeatureType::LineString, {{}}, {} } + { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}}, properties }, + { {}, FeatureType::LineString, { emptyLine }, properties }, + { {}, FeatureType::LineString, { emptyLine }, properties } }; mbgl::util::mergeLines(input2); @@ -72,14 +79,14 @@ TEST(MergeLines, BothEnds) { TEST(MergeLines, CircularLines) { // mergeLines handles circular lines std::vector<mbgl::SymbolFeature> input3; - input3.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}}}, {}, aaa, {}, 0 }); - input3.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{2, 0}, {3, 0}, {4, 0}}}, {}, aaa, {}, 0 }); - input3.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{4, 0}, {0, 0}}}, {}, aaa, {}, 0 }); + input3.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}}}, properties, aaa, {}, 0 }); + input3.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{2, 0}, {3, 0}, {4, 0}}}, properties, aaa, {}, 0 }); + input3.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{{4, 0}, {0, 0}}}, properties, aaa, {}, 0 }); const std::vector<StubGeometryTileFeature> expected3 = { - { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {0, 0}}}, {} }, - { {}, FeatureType::LineString, {{}}, {} }, - { {}, FeatureType::LineString, {{}}, {} } + { {}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {0, 0}}}, properties }, + { {}, FeatureType::LineString, { emptyLine }, properties }, + { {}, FeatureType::LineString, { emptyLine }, properties } }; mbgl::util::mergeLines(input3); @@ -91,9 +98,9 @@ TEST(MergeLines, CircularLines) { TEST(MergeLines, EmptyOuterGeometry) { std::vector<mbgl::SymbolFeature> input; - input.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {}, {}, aaa, {}, 0 }); + input.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {}, properties, aaa, {}, 0 }); - const std::vector<StubGeometryTileFeature> expected = { { {}, FeatureType::LineString, {}, {} } }; + const std::vector<StubGeometryTileFeature> expected = { { {}, FeatureType::LineString, {}, properties } }; mbgl::util::mergeLines(input); @@ -102,9 +109,9 @@ TEST(MergeLines, EmptyOuterGeometry) { TEST(MergeLines, EmptyInnerGeometry) { std::vector<mbgl::SymbolFeature> input; - input.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {{}}, {}, aaa, {}, 0 }); + input.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {}, properties, aaa, {}, 0 }); - const std::vector<StubGeometryTileFeature> expected = { { {}, FeatureType::LineString, {{}}, {} } }; + const std::vector<StubGeometryTileFeature> expected = { { {}, FeatureType::LineString, {}, properties } }; mbgl::util::mergeLines(input); |