summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-07-24 14:52:40 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-07-24 21:04:56 +0300
commit2c2e8589c341e2940202b781f7eb539b82b3599d (patch)
tree54611ad204129c78b7e8e6c96b497e842a1b3dd3 /test
parenta242bd107041bc740788ee8298fd7848c923442f (diff)
downloadqtlocation-mapboxgl-2c2e8589c341e2940202b781f7eb539b82b3599d.tar.gz
[core] GeometryCollection must not be implicitly copied
Diffstat (limited to 'test')
-rw-r--r--test/gl/bucket.test.cpp2
-rw-r--r--test/util/merge_lines.test.cpp44
2 files changed, 23 insertions, 23 deletions
diff --git a/test/gl/bucket.test.cpp b/test/gl/bucket.test.cpp
index 9c9847cf4d..f97fd53919 100644
--- a/test/gl/bucket.test.cpp
+++ b/test/gl/bucket.test.cpp
@@ -131,7 +131,7 @@ TEST(Buckets, SymbolBucket) {
// SymbolBucket::addFeature() is a no-op.
GeometryCollection point { { { 0, 0 } } };
- bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, point, properties }, point, {}, PatternLayerMap());
+ bucket.addFeature(StubGeometryTileFeature { {}, FeatureType::Point, std::move(point), properties }, point, {}, PatternLayerMap());
ASSERT_FALSE(bucket.hasData());
ASSERT_FALSE(bucket.needsUpload());
diff --git a/test/util/merge_lines.test.cpp b/test/util/merge_lines.test.cpp
index 1c8c7aae8f..5dc846ad6e 100644
--- a/test/util/merge_lines.test.cpp
+++ b/test/util/merge_lines.test.cpp
@@ -42,14 +42,14 @@ TEST(MergeLines, SameText) {
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}}}, 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 }
- };
+ std::vector<StubGeometryTileFeature> expected1;
+ expected1.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}}, properties));
+ expected1.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, {{{4, 0}, {5, 0}, {6, 0}}}, properties));
+ expected1.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, {{{5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}}, properties));
+ expected1.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, { emptyLine }, properties));
+ expected1.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, { emptyLine }, properties));
+ expected1.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, { emptyLine }, properties));
+
mbgl::util::mergeLines(input1);
@@ -65,11 +65,11 @@ TEST(MergeLines, BothEnds) {
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}}}, properties },
- { {}, FeatureType::LineString, { emptyLine }, properties },
- { {}, FeatureType::LineString, { emptyLine }, properties }
- };
+ std::vector<StubGeometryTileFeature> expected2;
+ expected2.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}}, properties));
+ expected2.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, { emptyLine }, properties));
+ expected2.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, { emptyLine }, properties));
+
mbgl::util::mergeLines(input2);
@@ -85,11 +85,11 @@ TEST(MergeLines, CircularLines) {
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}}}, properties },
- { {}, FeatureType::LineString, { emptyLine }, properties },
- { {}, FeatureType::LineString, { emptyLine }, properties }
- };
+ std::vector<StubGeometryTileFeature> expected3;
+ expected3.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {0, 0}}}, properties));
+ expected3.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, { emptyLine }, properties));
+ expected3.emplace_back(StubGeometryTileFeature({}, FeatureType::LineString, { emptyLine }, properties));
+
mbgl::util::mergeLines(input3);
@@ -102,20 +102,20 @@ TEST(MergeLines, EmptyOuterGeometry) {
std::vector<mbgl::SymbolFeature> input;
input.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {}, properties, aaa, {}, 0 });
- const std::vector<StubGeometryTileFeature> expected = { { {}, FeatureType::LineString, {}, properties } };
+ const StubGeometryTileFeature expected{ {}, FeatureType::LineString, {}, properties };
mbgl::util::mergeLines(input);
- EXPECT_EQ(input[0].geometry, expected[0].getGeometries());
+ EXPECT_EQ(input[0].geometry, expected.getGeometries());
}
TEST(MergeLines, EmptyInnerGeometry) {
std::vector<mbgl::SymbolFeature> input;
input.push_back(SymbolFeatureStub { {}, FeatureType::LineString, {}, properties, aaa, {}, 0 });
- const std::vector<StubGeometryTileFeature> expected = { { {}, FeatureType::LineString, {}, properties } };
+ const StubGeometryTileFeature expected{ {}, FeatureType::LineString, {}, properties };
mbgl::util::mergeLines(input);
- EXPECT_EQ(input[0].geometry, expected[0].getGeometries());
+ EXPECT_EQ(input[0].geometry, expected.getGeometries());
}