summaryrefslogtreecommitdiff
path: root/test/style
diff options
context:
space:
mode:
authorzmiao <miao.zhao@mapbox.com>2020-04-25 01:12:45 +0300
committerGitHub <noreply@github.com>2020-04-24 15:12:45 -0700
commit9bbb1b721e56e07666f6b0819594c4bfda84435e (patch)
tree66ca511509874d22f61eecd41eeb098dc420d59a /test/style
parent0ccc9f26899125889f51ad006ce1cdf65d87b069 (diff)
downloadqtlocation-mapboxgl-9bbb1b721e56e07666f6b0819594c4bfda84435e.tar.gz
[core] Distance expression: remove unit argument (#16434)
Diffstat (limited to 'test/style')
-rw-r--r--test/style/property_expression.test.cpp76
1 files changed, 0 insertions, 76 deletions
diff --git a/test/style/property_expression.test.cpp b/test/style/property_expression.test.cpp
index 41f8238c70..924b0f91f6 100644
--- a/test/style/property_expression.test.cpp
+++ b/test/style/property_expression.test.cpp
@@ -550,82 +550,6 @@ TEST(PropertyExpression, DistanceExpression) {
propExpr.evaluate(EvaluationContext(&pointFeature).withCanonicalTileID(&canonicalTileID), invalidResult);
EXPECT_NEAR(491.307, evaluatedResult, 0.01);
- // Unit: meters
- ss.str(std::string());
- ss << std::string(R"(["distance", )") << pointGeoSource << std::string(R"(, "meters" ])");
- expression = createExpression(ss.str().c_str());
- ASSERT_TRUE(expression);
- propExpr = std::move(expression);
-
- evaluatedResult =
- propExpr.evaluate(EvaluationContext(&pointFeature).withCanonicalTileID(&canonicalTileID), invalidResult);
- EXPECT_NEAR(491.307, evaluatedResult, 0.01);
-
- // Unit: kilometers
- ss.str(std::string());
- ss << std::string(R"(["distance", )") << pointGeoSource << std::string(R"(, "kilometers" ])");
- expression = createExpression(ss.str().c_str());
- ASSERT_TRUE(expression);
- propExpr = std::move(expression);
-
- evaluatedResult =
- propExpr.evaluate(EvaluationContext(&pointFeature).withCanonicalTileID(&canonicalTileID), invalidResult);
- EXPECT_NEAR(0.491307, evaluatedResult, 0.00001);
-
- // Unit: miles
- ss.str(std::string());
- ss << std::string(R"(["distance", )") << pointGeoSource << std::string(R"(, "miles" ])");
- expression = createExpression(ss.str().c_str());
- ASSERT_TRUE(expression);
- propExpr = std::move(expression);
-
- evaluatedResult =
- propExpr.evaluate(EvaluationContext(&pointFeature).withCanonicalTileID(&canonicalTileID), invalidResult);
- EXPECT_NEAR(0.305284, evaluatedResult, 0.00001);
-
- // Unit: nauticalmiles
- ss.str(std::string());
- ss << std::string(R"(["distance", )") << pointGeoSource << std::string(R"(, "nauticalmiles" ])");
- expression = createExpression(ss.str().c_str());
- ASSERT_TRUE(expression);
- propExpr = std::move(expression);
-
- evaluatedResult =
- propExpr.evaluate(EvaluationContext(&pointFeature).withCanonicalTileID(&canonicalTileID), invalidResult);
- EXPECT_NEAR(0.265284, evaluatedResult, 0.00001);
-
- // Unit: yards
- ss.str(std::string());
- ss << std::string(R"(["distance", )") << pointGeoSource << std::string(R"(, "yards" ])");
- expression = createExpression(ss.str().c_str());
- ASSERT_TRUE(expression);
- propExpr = std::move(expression);
-
- evaluatedResult =
- propExpr.evaluate(EvaluationContext(&pointFeature).withCanonicalTileID(&canonicalTileID), invalidResult);
- EXPECT_NEAR(537.299, evaluatedResult, 0.01);
-
- // Unit: feet
- ss.str(std::string());
- ss << std::string(R"(["distance", )") << pointGeoSource << std::string(R"(, "feet" ])");
- expression = createExpression(ss.str().c_str());
- ASSERT_TRUE(expression);
- propExpr = std::move(expression);
-
- evaluatedResult =
- propExpr.evaluate(EvaluationContext(&pointFeature).withCanonicalTileID(&canonicalTileID), invalidResult);
- EXPECT_NEAR(1611.898, evaluatedResult, 0.01);
-
- // Unit: inches
- ss.str(std::string());
- ss << std::string(R"(["distance", )") << pointGeoSource << std::string(R"(, "inches" ])");
- expression = createExpression(ss.str().c_str());
- ASSERT_TRUE(expression);
- propExpr = std::move(expression);
-
- evaluatedResult =
- propExpr.evaluate(EvaluationContext(&pointFeature).withCanonicalTileID(&canonicalTileID), invalidResult);
- EXPECT_NEAR(19342.781, evaluatedResult, 0.01);
}
// Evaluation test with Point to MultiPoint distance