mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-17 13:52:09 +00:00
[test][strategies][douglas peucker] make the unit test for this strategy
platform portable and platform independent
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include <boost/geometry/geometries/register/multi_point.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/equals.hpp>
|
||||
#include <boost/geometry/algorithms/comparable_distance.hpp>
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
#include <boost/geometry/io/dsv/write.hpp>
|
||||
@@ -221,12 +222,15 @@ inline void test_with_strategy()
|
||||
|
||||
typedef bg::model::point<CoordinateType, 2, bg::cs::cartesian> point_type;
|
||||
typedef bg::model::linestring<point_type> linestring_type;
|
||||
typedef bg::model::segment<point_type> segment_type;
|
||||
typedef test_one_case<linestring_type> tester;
|
||||
|
||||
linestring_type ls1, ls2;
|
||||
linestring_type res1, res2;
|
||||
point_type const p1(-6,-13), p2(0,-15);
|
||||
segment_type const s(point_type(12,-3), point_type(-12,5));
|
||||
|
||||
if (boost::is_same<CoordinateType, long double>::value)
|
||||
if (bg::comparable_distance(p1, s) >= bg::comparable_distance(p2, s))
|
||||
{
|
||||
tester::apply("LINESTRING(12 -3, 4 8,-6 -13,-9 4,0 -15,-12 5)",
|
||||
10,
|
||||
|
||||
Reference in New Issue
Block a user