[algorithm] [test] Assertion for possible division with zero in line_interpolate

This commit is contained in:
Vissarion Fysikopoulos
2019-02-18 14:43:53 +02:00
parent f83cb027b5
commit d0331aa3eb
2 changed files with 7 additions and 1 deletions

View File

@@ -137,6 +137,7 @@ std::string const l1 = "LINESTRING(1 1, 2 1, 2 2, 1 2, 1 3)";
std::string const l2 = "LINESTRING(0 2, 5 2, 5 1, 20 1)";
std::string const l00 = "LINESTRING()";
std::string const l01 = "LINESTRING(1 1)";
std::string const l02 = "LINESTRING(1 1, 1 1)";
void test_car_edge_cases()
{
@@ -156,6 +157,10 @@ void test_car_edge_cases()
test_distance<LS,P>(l01, 1, "POINT(1 1)");
test_distance<LS,MP>(l01, 1, "MULTIPOINT((1 1))");
//linestring with two same points
test_distance<LS,P>(l02, 1, "POINT(1 1)");
test_distance<LS,MP>(l02, 1, "MULTIPOINT((1 1))");
//empty linestring
try
{