[test] move bug 21155501 to difference_multi and test it the normal way,

still showing that validity should be checked too
This commit is contained in:
Barend Gehrels
2015-11-01 16:54:25 +01:00
parent a98772cba0
commit adb2cccdd7
3 changed files with 25 additions and 31 deletions

View File

@@ -475,4 +475,12 @@ static std::string ticket_11674[2] =
"MULTIPOLYGON(((528 3218,528 2498,1734 1406,2556 1522,1734 1784,528 3218)),((4610 2288,5340 1178,5340 1832,4609 2289,4140 3002,2934 1574,2555 1521,2934 1400,4140 2582,4610 2288)))",
};
static std::string bug_21155501[2] =
{
"MULTIPOLYGON(((-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)))",
"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)))",
};
#endif // BOOST_GEOMETRY_TEST_MULTI_OVERLAY_CASES_HPP

View File

@@ -40,33 +40,6 @@
#endif
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()
{
@@ -555,10 +528,6 @@ int test_main(int, char* [])
test_specific<bg::model::d2::point_xy<int>, false, false>();
#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS
test_bug21155501<double>();
#endif
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
test_all<bg::model::d2::point_xy<float> >();

View File

@@ -146,6 +146,23 @@ void test_areal()
tolerance(0.001));
#endif
{
// Bug 21155501
// POSTGIS areas: 3.75893745345145, 2.5810000723917e-15
ut_settings settings;
#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS
settings.test_validity = true;
#endif
test_one<Polygon, MultiPolygon, MultiPolygon>("bug_21155501",
bug_21155501[0], bug_21155501[1],
1, 9, 3.758937,
0, 0, 0.0,
settings);
}
/* TODO: fix
test_one<Polygon, MultiPolygon, MultiPolygon>("case_101_multi",
case_101_multi[0], case_101_multi[1],