diff --git a/test/algorithms/relate/Jamfile b/test/algorithms/relate/Jamfile index d1d8264a0..d18030c87 100644 --- a/test/algorithms/relate/Jamfile +++ b/test/algorithms/relate/Jamfile @@ -16,7 +16,7 @@ test-suite boost-geometry-algorithms-relate : - [ run relate_const.cpp : : : : algorithms_relate_const ] + [ run relate_const_custom.cpp : : : : algorithms_relate_const_custom ] [ run relate_areal_areal.cpp : : : : algorithms_relate_areal_areal ] [ run relate_areal_areal_sph.cpp : : : : algorithms_relate_areal_areal_sph ] [ run relate_linear_areal.cpp : : : : algorithms_relate_linear_areal ] diff --git a/test/algorithms/relate/relate_const.cpp b/test/algorithms/relate/relate_const_custom.cpp similarity index 87% rename from test/algorithms/relate/relate_const.cpp rename to test/algorithms/relate/relate_const_custom.cpp index 290c7ef5f..9517543b4 100644 --- a/test/algorithms/relate/relate_const.cpp +++ b/test/algorithms/relate/relate_const_custom.cpp @@ -8,6 +8,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include @@ -39,7 +40,6 @@ void test_relate_const(Geometry1 const &geometry1, Geometry2 const &geometry2, BOOST_CHECK_EQUAL(exp_within, bg::within(geometry1, geometry2)); } - int test_main(int, char* []) { ring_of_const_point const rectangle{{2, 2}, {2, 4}, {4, 4}, {4, 2}, {2, 2}}; @@ -59,5 +59,16 @@ int test_main(int, char* []) // linear/linear test_relate_const(horizontal, diagonal, false, true, false, true, false, false, false, false); + custom_cartesian_line l; + custom_cartesian_polygon poly; + bg::covered_by(l, poly); + bg::crosses(l, poly); + bg::disjoint(l, poly); + bg::intersects(l, poly); + bg::overlaps(l, poly); + bg::touches(l, poly); + bg::relate(l, poly, bg::de9im::mask("F0F******")); + bg::within(l, poly); + return 0; } diff --git a/test/test_geometries/const_point.hpp b/test/test_geometries/const_point.hpp index d144e6b2f..8a1b9c757 100644 --- a/test/test_geometries/const_point.hpp +++ b/test/test_geometries/const_point.hpp @@ -43,5 +43,4 @@ namespace boost { namespace geometry { namespace traits { }}} - #endif diff --git a/test/test_geometries/custom_cartesian_point.hpp b/test/test_geometries/custom_cartesian_point.hpp new file mode 100644 index 000000000..375346bb3 --- /dev/null +++ b/test/test_geometries/custom_cartesian_point.hpp @@ -0,0 +1,22 @@ +// Boost.Geometry + +// Copyright (c) 2022 Oracle and/or its affiliates. + +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include + +struct custom_cartesian_point { + double x, y; + custom_cartesian_point(double x = 0, double y = 0) : x(x), y(y) {} +}; + +BOOST_GEOMETRY_REGISTER_POINT_2D(custom_cartesian_point, double, + boost::geometry::cs::cartesian, x, y); + +using custom_cartesian_line = boost::geometry::model::linestring; +using custom_cartesian_polygon = boost::geometry::model::polygon; \ No newline at end of file