mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[test][difference] Add failing case.
This commit is contained in:
parent
18607a9b38
commit
2fe55e07dd
@ -170,6 +170,33 @@ void test_ticket_11121()
|
||||
BOOST_CHECK(bg::is_valid(sym_diff));
|
||||
}
|
||||
|
||||
template <typename CoordinateType>
|
||||
void test_bug21155501()
|
||||
{
|
||||
typedef bg::model::point<CoordinateType,2,bg::cs::cartesian> point_type;
|
||||
typedef bg::model::polygon
|
||||
<
|
||||
point_type, /*ClockWise*/false, /*Closed*/false
|
||||
> polygon_type;
|
||||
typedef bg::model::multi_polygon<polygon_type> multipolygon_type;
|
||||
|
||||
polygon_type g1;
|
||||
bg::read_wkt("POLYGON((-8.3935546875 27.449790329784214,4.9658203125 18.729501999072138,11.8212890625 23.563987128451217,9.7119140625 25.48295117535531,9.8876953125 31.728167146023935,8.3056640625 32.99023555965106,8.5693359375 37.16031654673677,-1.8896484375 35.60371874069731,-0.5712890625 32.02670629333614,-8.9208984375 29.458731185355344,-8.3935546875 27.449790329784214))", g1);
|
||||
multipolygon_type g2;
|
||||
bg::read_wkt("MULTIPOLYGON(((4.9658203125 18.729501999072138,-3.4868710311820115 24.246968623627644,8.3589904332912 33.833614418115445,8.3056640625 32.99023555965106,9.8876953125 31.728167146023935,9.7119140625 25.48295117535531,11.8212890625 23.563987128451217,4.9658203125 18.729501999072138)),((-3.88714525609152 24.508246314579743,-8.3935546875 27.449790329784214,-8.9208984375 29.458731185355344,-0.5712890625 32.02670629333614,-1.8896484375 35.60371874069731,8.5693359375 37.16031654673677,8.362166569827938 33.883846345901595,-3.88714525609152 24.508246314579743)))", g2);
|
||||
bg::correct(g1);
|
||||
bg::correct(g2);
|
||||
|
||||
multipolygon_type diff12, diff21, sym_diff;
|
||||
bg::difference(g1, g2, diff12);
|
||||
bg::difference(g2, g1, diff21);
|
||||
bg::sym_difference(g1, g2, sym_diff);
|
||||
|
||||
BOOST_CHECK(bg::is_valid(diff12));
|
||||
BOOST_CHECK(bg::is_valid(diff21));
|
||||
BOOST_CHECK(bg::is_valid(sym_diff));
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
@ -676,6 +703,10 @@ int test_main(int, char* [])
|
||||
|
||||
test_ticket_11121<int>();
|
||||
|
||||
#ifdef BOOST_GEOMETRY_TEST_ENABLE_FAILING
|
||||
test_bug21155501<double>();
|
||||
#endif
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_all<bg::model::d2::point_xy<float> >();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user