[test] added failing test cases for tickets #11674, #11676

This commit is contained in:
Barend Gehrels 2015-11-01 13:39:41 +01:00
parent 50c7e922d4
commit 29e1595e3f
4 changed files with 48 additions and 3 deletions

View File

@ -461,12 +461,18 @@ static std::string ticket_9081[2] =
"MULTIPOLYGON(((0.2099392122251989 0.492066865490789,0.1124301889095737 0.5124668111209448,0.3306914939102383 0.6126684490171914,0.2099392122251989 0.492066865490789)),((0.5885369465145437 0.6478961722242873,0.5342320718598281 0.6686303269145104,0.5619623880692838 0.7033299168703926,0.5945761233023867 0.6823532655194001,0.5885369465145437 0.6478961722242873)),((0.5570738195183501 0.6001870087680015,0.5429714753344335 0.6231021858940831,0.5880357506342242 0.6450365518134291,0.5838690879677763 0.6212632646137447,0.568218114394707 0.5970364466647042,0.5570738195183501 0.6001870087680015)),((0.5498478321815098 0.5029279381860542,0.608691671498764 0.5163121433149205,0.5636607291345047 0.5894838094559455,0.8595233008819849 0.8301950132755517,0.8285440738598029 0.8412277162756114,0.9591357158116398 0.9011810663167211,0.8572649311807611 0.3566393017365032,0.5965816668471951 0.4111770689940296,0.5498478321815098 0.5029279381860542)),((0.3984249865018206 0.4526335964808558,0.3621206996557855 0.4602288471829723,0.4183516736935784 0.4730187483833363,0.4099611282054451 0.4644351568071601,0.3984249865018206 0.4526335964808558)))"
};
// Reported by Volker, based on integer
// Integer, ccw, open
static std::string ticket_10803[2] =
{
"MULTIPOLYGON(((3174 1374,3174 2886,1374 2886,1374 2139,3174 1374)))",
"MULTIPOLYGON(((1374 1092,1734 1092,3174 2526,3174 2886,1374 2886,1374 1092)))"
};
// Integer, ccw, open
static std::string ticket_11674[2] =
{
"MULTIPOLYGON(((529 3217,529 998,5337 998,5337 1834,5070 2000,5337 2072,5337 3475,529 3475,529 3312,1734 2054,2934 1670,3230 1690,2934 1400,1734 1784,529 3217),(4140 2582,5071 2001,4140 1754,3231 1691,4140 2582)))",
"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)))",
};
#endif // BOOST_GEOMETRY_TEST_MULTI_OVERLAY_CASES_HPP

View File

@ -889,6 +889,13 @@ static std::string ticket_11725_2[2] =
"POLYGON((3 1, 1 1, 1 2, 2 2, 3 1))",
};
// Integer, ccw, open
static std::string ticket_11676[2] =
{
"POLYGON((1920 1660,1920 1462,3720 1462,3720 3262,1920 3262,1920 1959,2218 2189,1920 1660),(3718 1561,3360 2233,3718 1957,3718 1561),(2818 2653,2218 2189,2818 3253,3360 2233,2818 2653))",
"POLYGON((1918 2155,1918 1957,2818 2653,3718 1957,3718 2154,2818 3055,1918 2155))",
};
static std::string mysql_21964079_1[2] =
{
"POLYGON((7 3,0 10,0 -6,9 -5, 7 7, 7 3), (0 8, 2 3, 2 -2, 0 8))",

View File

@ -554,10 +554,11 @@ void test_all()
}
template <typename P, bool clockwise, bool closed>
// Test cases for integer coordinates / ccw / open
template <typename Point, bool ClockWise, bool Closed>
void test_specific()
{
typedef bg::model::polygon<P, clockwise, closed> polygon;
typedef bg::model::polygon<Point, ClockWise, Closed> polygon;
test_one<polygon, polygon, polygon>("ggl_list_20120717_volker",
ggl_list_20120717_volker[0], ggl_list_20120717_volker[1],
@ -575,6 +576,15 @@ void test_specific()
ticket_11121[0], ticket_11121[1],
2, 8, 489763.5,
1, 4, 6731652.0);
#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS
// Generates spikes, both a-b and b-a
test_one<polygon, polygon, polygon>("ticket_11676",
ticket_11676[0], ticket_11676[1],
1, 18, 2537992.5,
2, 11, 294963.5,
2, -1, 2537992.5 + 294963.5);
#endif
}

View File

@ -183,10 +183,32 @@ void test_all()
}
// Test cases for integer coordinates / ccw / open
template <typename Point, bool ClockWise, bool Closed>
void test_specific()
{
typedef bg::model::polygon<Point, ClockWise, Closed> polygon;
typedef bg::model::multi_polygon<polygon> multi_polygon;
boost::ignore_unused<polygon, multi_polygon>();
#ifdef BOOST_GEOMETRY_TEST_INCLUDE_FAILING_TESTS
// Spikes in a-b and b-a, failure in symmetric difference
test_one<polygon, multi_polygon, multi_polygon>("ticket_11674",
ticket_11674[0], ticket_11674[1],
3, 27, 9105781.5,
5, 22, 119059.5,
2, -1, -1);
#endif
}
int test_main(int, char* [])
{
test_all<bg::model::d2::point_xy<double> >();
test_specific<bg::model::d2::point_xy<int>, false, false>();
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
test_all<bg::model::d2::point_xy<float> >();