diff --git a/test/algorithms/covered_by/Jamfile b/test/algorithms/covered_by/Jamfile index 0a7b57359..e044d900f 100644 --- a/test/algorithms/covered_by/Jamfile +++ b/test/algorithms/covered_by/Jamfile @@ -4,8 +4,8 @@ # Copyright (c) 2008-2015 Bruno Lalande, Paris, France. # Copyright (c) 2009-2015 Mateusz Loskot, London, UK. # -# This file was modified by Oracle on 2014, 2015, 2016. -# Modifications copyright (c) 2014-2016, Oracle and/or its affiliates. +# This file was modified by Oracle on 2014-2022. +# Modifications copyright (c) 2014-2022, Oracle and/or its affiliates. # # Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle # Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -17,6 +17,7 @@ test-suite boost-geometry-algorithms-covered_by : [ run covered_by.cpp : : : : algorithms_covered_by ] + [ run covered_by_gc.cpp : : : : algorithms_covered_by_gc ] [ run covered_by_multi.cpp : : : : algorithms_covered_by_multi ] [ run covered_by_sph.cpp : : : : algorithms_covered_by_sph ] [ run covered_by_sph_geo.cpp : : : : algorithms_covered_by_sph_geo ] diff --git a/test/algorithms/covered_by/covered_by_gc.cpp b/test/algorithms/covered_by/covered_by_gc.cpp new file mode 100644 index 000000000..916ca4456 --- /dev/null +++ b/test/algorithms/covered_by/covered_by_gc.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry + +// Copyright (c) 2022 Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, 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 "test_covered_by.hpp" + +#include + +using pt_t = bg::model::point; +using ls_t = bg::model::linestring; +using po_t = bg::model::polygon; +using mpt_t = bg::model::multi_point; +using mls_t = bg::model::multi_linestring; +using mpo_t = bg::model::multi_polygon; +using var_t = boost::variant; +//using var_t = boost::variant2::variant; +using gc_t = bg::model::geometry_collection; + +void test_gc() +{ + test_geometry("GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 4 4))", + "GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 4, 4 1))", + true); + test_geometry("GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 6 6))", + "GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 4, 4 1))", + false); + // ERROR IN RELATE + /*test_geometry("GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 4, 4 1))", + "GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 6 6))", + true);*/ + test_geometry("GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 6 6))", + "GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(5 5, 6 6))", + true); + test_geometry("GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 6 6), POINT(0 6))", + "GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(5 5, 6 6))", + false); + test_geometry("GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(5 5, 6 6))", + "GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 6 6), POINT(0 6))", + true); + test_geometry("GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 6 6), POINT(0 6))", + "GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(5 5, 6 6), POINT(0 6))", + true); + + + test_geometry("POLYGON((0 0,0 5,5 5,5 0,0 0))", + "GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 4 4))", + true); + test_geometry("GEOMETRYCOLLECTION(POLYGON((0 0,0 5,5 5,5 0,0 0)), LINESTRING(1 1, 6 6))", + "POLYGON((0 0,0 5,5 5,5 0,0 0))", + false); +} + +int test_main(int , char* []) +{ + test_gc(); + + return 0; +} diff --git a/test/algorithms/covered_by/test_covered_by.hpp b/test/algorithms/covered_by/test_covered_by.hpp index e22ed03fd..8872f3408 100644 --- a/test/algorithms/covered_by/test_covered_by.hpp +++ b/test/algorithms/covered_by/test_covered_by.hpp @@ -4,8 +4,8 @@ // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2017. -// Modifications copyright (c) 2017 Oracle and/or its affiliates. +// This file was modified by Oracle on 2017-2022. +// Modifications copyright (c) 2017-2022 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -76,7 +76,7 @@ void test_geometry(std::string const& wkt1, boost::variant v1(geometry1); boost::variant v2(geometry2); - typedef typename bg::strategy::covered_by::services::default_strategy + typedef typename bg::strategies::relate::services::default_strategy < Geometry1, Geometry2 >::type strategy_type;