[test] add testcases 17,18,19,20

This commit is contained in:
Barend Gehrels 2019-05-01 15:45:15 +02:00
parent bde086d944
commit bcb9f60bec
3 changed files with 60 additions and 9 deletions

View File

@ -802,6 +802,31 @@ static std::string case_precision_16[2] =
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4 2.99999940000000009,4 7,2 7))"
};
static std::string case_precision_17[2] =
{
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2 3,4 3.00000499999999999,4 7,2 7))"
};
static std::string case_precision_18[2] =
{
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,2.00000199999999984 3.00000400000000012,4 3,4 7,2 7))"
};
static std::string case_precision_19[2] =
{
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
"POLYGON((-1 -1,-1 8,8 8,8 -1,-1 -1),(2 7,1.99999199999999999 2.99999400000000005,4 3,4 7,2 7))"
};
static std::string case_precision_20[2] =
{
"POLYGON((0 0,0 4,2 4,2 3,4 3,4 0,0 0))",
"POLYGON((2 7,4 7,4 3,2.00000000000000044 3,2 7))"
};
// ticket_17 is keyholed, so has a hole formed by an deliberate intersection
// This will fail the intersection/traversal process
static std::string ticket_17[2] = {

View File

@ -371,6 +371,22 @@ void test_areal()
TEST_INTERSECTION(case_precision_10, 1, -1, 14.0);
TEST_INTERSECTION(case_precision_11, 1, -1, 14.0);
{
ut_settings settings(0.01);
TEST_INTERSECTION_WITH(case_precision_12, 0, 1, 1, -1, 2.0, settings);
TEST_INTERSECTION_WITH(case_precision_13, 0, 1, 1, -1, 2.0, settings);
TEST_INTERSECTION_WITH(case_precision_12, 1, 0, 1, -1, 2.0, settings);
TEST_INTERSECTION_WITH(case_precision_13, 1, 0, 1, -1, 2.0, settings);
}
TEST_INTERSECTION(case_precision_14, 0, -1, 0.0);
TEST_INTERSECTION(case_precision_15, 1, -1, 14.0);
TEST_INTERSECTION(case_precision_16, 1, -1, 14.0);
TEST_INTERSECTION(case_precision_17, 1, -1, 14.0);
TEST_INTERSECTION(case_precision_18, 1, -1, 14.0);
TEST_INTERSECTION(case_precision_19, 1, -1, 14.0);
TEST_INTERSECTION(case_precision_20, 0, 0, 0.0);
TEST_INTERSECTION_REV(case_precision_1, 0, 0, 0.0);
TEST_INTERSECTION_REV(case_precision_2, 0, 0, 0.0);
TEST_INTERSECTION_REV(case_precision_3, 0, 0, 0.0);
@ -382,16 +398,14 @@ void test_areal()
TEST_INTERSECTION_REV(case_precision_9, 1, -1, 14.0);
TEST_INTERSECTION_REV(case_precision_10, 1, -1, 14.0);
TEST_INTERSECTION_REV(case_precision_11, 1, -1, 14.0);
{
ut_settings settings(0.01);
TEST_INTERSECTION_WITH(case_precision_12, 0, 1, 1, -1, 2.0, settings);
TEST_INTERSECTION_WITH(case_precision_13, 0, 1, 1, -1, 2.0, settings);
TEST_INTERSECTION_WITH(case_precision_12, 1, 0, 1, -1, 2.0, settings);
TEST_INTERSECTION_WITH(case_precision_13, 1, 0, 1, -1, 2.0, settings);
}
TEST_INTERSECTION(case_precision_14, 0, -1, 0.0);
TEST_INTERSECTION(case_precision_15, 1, -1, 14.0);
TEST_INTERSECTION_REV(case_precision_14, 0, -1, 0.0);
TEST_INTERSECTION_REV(case_precision_15, 1, -1, 14.0);
TEST_INTERSECTION_REV(case_precision_16, 1, -1, 14.0);
TEST_INTERSECTION_REV(case_precision_17, 1, -1, 14.0);
TEST_INTERSECTION_REV(case_precision_18, 1, -1, 14.0);
TEST_INTERSECTION_REV(case_precision_19, 1, -1, 14.0);
TEST_INTERSECTION_REV(case_precision_20, 0, 0, 0.0);
test_one<Polygon, Polygon, Polygon>("mysql_21964049",
mysql_21964049[0], mysql_21964049[1],

View File

@ -271,6 +271,12 @@ void test_areal()
TEST_UNION(case_precision_14, 1, 0, -1, 22.0);
TEST_UNION(case_precision_15, 1, 1, -1, 73.0);
TEST_UNION(case_precision_16, 1, 1, -1, 73.0);
TEST_UNION(case_precision_17, 1, 1, -1, 73.0);
TEST_UNION(case_precision_18, 1, 1, -1, 73.0);
TEST_UNION(case_precision_19, 1, 1, -1, 73.0);
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
TEST_UNION(case_precision_20, 1, 0, -1, 22.0);
#endif
TEST_UNION_REV(case_precision_1, 1, 0, -1, 22.0);
TEST_UNION_REV(case_precision_2, 1, 0, -1, 22.0);
@ -288,6 +294,12 @@ void test_areal()
TEST_UNION_REV(case_precision_14, 1, 0, -1, 22.0);
TEST_UNION_REV(case_precision_15, 1, 1, -1, 73.0);
TEST_UNION_REV(case_precision_16, 1, 1, -1, 73.0);
TEST_UNION_REV(case_precision_17, 1, 1, -1, 73.0);
TEST_UNION_REV(case_precision_18, 1, 1, -1, 73.0);
TEST_UNION_REV(case_precision_19, 1, 1, -1, 73.0);
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_ENABLE_FAILING)
TEST_UNION_REV(case_precision_20, 1, 0, -1, 22.0);
#endif
/*
test_one<Polygon, Polygon, Polygon>(102,