diff --git a/test/algorithms/relational_operations/relate/relate_pointlike_xxx.cpp b/test/algorithms/relational_operations/relate/relate_pointlike_xxx.cpp index f9314454f..a747cc1e5 100644 --- a/test/algorithms/relational_operations/relate/relate_pointlike_xxx.cpp +++ b/test/algorithms/relational_operations/relate/relate_pointlike_xxx.cpp @@ -92,6 +92,8 @@ void test_all() int test_main( int , char* [] ) { + check_mask(); + test_all >(); test_all >(); diff --git a/test/algorithms/relational_operations/relate/test_relate.hpp b/test/algorithms/relational_operations/relate/test_relate.hpp index e0e0dadaa..77359d9ea 100644 --- a/test/algorithms/relational_operations/relate/test_relate.hpp +++ b/test/algorithms/relational_operations/relate/test_relate.hpp @@ -70,6 +70,44 @@ std::string matrix_format(std::string const& matrix1, std::string const& matrix2 + ( !matrix2.empty() ? " || " : "" ) + matrix2; } +template +char get_ii(M const& m) +{ + using bg::detail::relate::interior; + return m.template get(); +} + +template +char get_ee(M const& m) +{ + using bg::detail::relate::exterior; + return m.template get(); +} + +void check_mask() +{ + bg::de9im::mask m1(""); + bg::de9im::mask m2("TTT"); + bg::de9im::mask m3("000111222"); + bg::de9im::mask m4("000111222FFFF"); + bg::de9im::mask m5(std::string("")); + bg::de9im::mask m6(std::string("TTT")); + bg::de9im::mask m7(std::string("000111222")); + bg::de9im::mask m8(std::string("000111222FFFF")); + + using bg::detail::relate::interior; + using bg::detail::relate::exterior; + + BOOST_CHECK(get_ii(m1) == '*' && get_ee(m1) == '*'); + BOOST_CHECK(get_ii(m2) == 'T' && get_ee(m2) == '*'); + BOOST_CHECK(get_ii(m3) == '0' && get_ee(m3) == '2'); + BOOST_CHECK(get_ii(m4) == '0' && get_ee(m4) == '2'); + BOOST_CHECK(get_ii(m5) == '*' && get_ee(m5) == '*'); + BOOST_CHECK(get_ii(m6) == 'T' && get_ee(m6) == '*'); + BOOST_CHECK(get_ii(m7) == '0' && get_ee(m7) == '2'); + BOOST_CHECK(get_ii(m8) == '0' && get_ee(m8) == '2'); +} + template void check_geometry(Geometry1 const& geometry1, Geometry2 const& geometry2,