diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/api/annotations.test.cpp | 4 | ||||
-rw-r--r-- | test/src/mbgl/test/conversion_stubs.hpp | 2 | ||||
-rw-r--r-- | test/style/conversion/geojson_options.test.cpp | 12 | ||||
-rw-r--r-- | test/style/filter.test.cpp | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/test/api/annotations.test.cpp b/test/api/annotations.test.cpp index a56992bc28..31277718da 100644 --- a/test/api/annotations.test.cpp +++ b/test/api/annotations.test.cpp @@ -340,12 +340,12 @@ TEST(Annotations, QueryRenderedFeatures) { auto features = test.map.queryRenderedFeatures(test.map.pixelForLatLng({ 0, 0 })); EXPECT_EQ(features.size(), 1u); EXPECT_TRUE(!!features[0].id); - EXPECT_EQ(*features[0].id, 0); + EXPECT_EQ(*features[0].id, uint64_t(0)); auto features2 = test.map.queryRenderedFeatures(test.map.pixelForLatLng({ 50, 0 })); EXPECT_EQ(features2.size(), 1u); EXPECT_TRUE(!!features2[0].id); - EXPECT_EQ(*features2[0].id, 1); + EXPECT_EQ(*features2[0].id, uint64_t(1)); } TEST(Annotations, QueryFractionalZoomLevels) { diff --git a/test/src/mbgl/test/conversion_stubs.hpp b/test/src/mbgl/test/conversion_stubs.hpp index b80a2c98bd..ddffb1e3b2 100644 --- a/test/src/mbgl/test/conversion_stubs.hpp +++ b/test/src/mbgl/test/conversion_stubs.hpp @@ -104,7 +104,7 @@ inline optional<mbgl::Value> toValue(const Value& value) { } else if (value.is<std::string>()) { return { value.get<std::string>() }; } else if (value.is<float>()) { - return { value.get<float>() }; + return { double(value.get<float>()) }; } else { return {}; } diff --git a/test/style/conversion/geojson_options.test.cpp b/test/style/conversion/geojson_options.test.cpp index dc9be237a8..14a7adbba7 100644 --- a/test/style/conversion/geojson_options.test.cpp +++ b/test/style/conversion/geojson_options.test.cpp @@ -17,7 +17,7 @@ TEST(GeoJSONOptions, Basic) { } TEST(GeoJSONOptions, ErrorHandling) { - ValueMap map {{"maxzoom", "should not be a string"}}; + ValueMap map {{"maxzoom", std::string{"should not be a string"}}}; Value raw(map); Result<GeoJSONOptions> converted = convert<GeoJSONOptions>(raw); ASSERT_FALSE((bool) converted); @@ -44,14 +44,14 @@ TEST(GeoJSONOptions, RetainsDefaults) { TEST(GeoJSONOptions, FullConversion) { ValueMap map { //GeoJSON-VT - {"maxzoom", 1}, - {"buffer", 2}, - {"tolerance", 3}, + {"maxzoom", 1.0f}, + {"buffer", 2.0f}, + {"tolerance", 3.0f}, //Supercluster {"cluster", true}, - {"clusterRadius", 4}, - {"clusterMaxZoom", 5} + {"clusterRadius", 4.0f}, + {"clusterMaxZoom", 5.0f} }; Value raw(map); GeoJSONOptions converted = *convert<GeoJSONOptions>(raw); diff --git a/test/style/filter.test.cpp b/test/style/filter.test.cpp index b49f424a39..33b64978f5 100644 --- a/test/style/filter.test.cpp +++ b/test/style/filter.test.cpp @@ -42,7 +42,7 @@ TEST(Filter, EqualsNumber) { ASSERT_FALSE(f(feature({{ "foo", std::string("0") }}))); ASSERT_FALSE(f(feature({{ "foo", false }}))); ASSERT_FALSE(f(feature({{ "foo", true }}))); - ASSERT_FALSE(f(feature({{ "foo", nullptr }}))); + ASSERT_FALSE(f(feature({{ "foo", mapbox::geometry::null_value }}))); ASSERT_FALSE(f(feature({{}}))); } @@ -113,13 +113,13 @@ TEST(Filter, NotHas) { TEST(Filter, ID) { Feature feature1 { Point<double>() }; - feature1.id = { 1234 }; + feature1.id = { uint64_t(1234) }; ASSERT_TRUE(parse("[\"==\", \"$id\", 1234]")(feature1)); ASSERT_FALSE(parse("[\"==\", \"$id\", \"1234\"]")(feature1)); Feature feature2 { Point<double>() }; - feature2.properties["id"] = { 1234 }; + feature2.properties["id"] = { uint64_t(1234) }; ASSERT_FALSE(parse("[\"==\", \"$id\", 1234]")(feature2)); } |