Skip to content

Commit

Permalink
[test] add testcase for issue boostorg#838
Browse files Browse the repository at this point in the history
  • Loading branch information
barendgehrels committed Apr 7, 2021
1 parent eee7fc5 commit e098a85
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/algorithms/overlay/overlay_cases.hpp
Expand Up @@ -1041,6 +1041,12 @@ static std::string issue_566_b[2] =
"POLYGON((0 0,0.148086 -7.06952,10.1459 -6.86009,9.99781 0.209424,0 0))"
};

static std::string issue_838[2] =
{
"POLYGON((27162.5232832765 -40045.435290614478,27162.764636849268 -40045.321663646188,27164.74034168441 -40044.391828870466,27164.854765308635 -40044.634874609801,27164.613411735867 -40044.748501578091,27162.637706900725 -40045.678336353812,27162.5232832765 -40045.435290614478))",
"POLYGON((27164.783474018484 -40044.371515841653,27165.010815897258 -40044.854409784071,27162.750625155277 -40045.918184556889,27162.523283276503 -40045.43529061447,27164.783474018484 -40044.371515841653))"
};

static std::string ggl_list_20120229_volker[3] =
{
"POLYGON((1716 1554,2076 2250,2436 2352,2796 1248,3156 2484,3516 2688,3516 2688,3156 2484,2796 1248,2436 2352,2076 2250, 1716 1554))",
Expand Down
7 changes: 7 additions & 0 deletions test/algorithms/set_operations/difference/difference.cpp
Expand Up @@ -574,6 +574,13 @@ void test_all()
optional(), optional_sliver(1.0e-5),
count_set(1, 2));

TEST_DIFFERENCE_WITH(issue_838, 2,
BG_IF_RESCALED(2.68771e-05,
2.68052e-05),
1, 0.674982,
BG_IF_RESCALED(3, 2),
ut_settings(0.001, BG_IF_RESCALED(true, false)));

TEST_DIFFERENCE(mysql_21977775, 2, 160.856568913, 2, 92.3565689126, 4);
TEST_DIFFERENCE(mysql_21965285, 1, 92.0, 1, 14.0, 1);
TEST_DIFFERENCE(mysql_23023665_1, 1, 92.0, 1, 142.5, 2);
Expand Down
2 changes: 2 additions & 0 deletions test/algorithms/set_operations/intersection/intersection.cpp
Expand Up @@ -305,6 +305,8 @@ void test_areal()
TEST_INTERSECTION(issue_566_a, 1, -1, 70.7107);
TEST_INTERSECTION(issue_566_b, 1, -1, 70.7107);

TEST_INTERSECTION(issue_838, 1, -1, 0.65829087);

test_one<Polygon, Polygon, Polygon>("buffer_mp1", buffer_mp1[0], buffer_mp1[1],
1, 31, 2.271707796);
test_one<Polygon, Polygon, Polygon>("buffer_mp2", buffer_mp2[0], buffer_mp2[1],
Expand Down
7 changes: 7 additions & 0 deletions test/algorithms/set_operations/union/union.cpp
Expand Up @@ -430,6 +430,13 @@ void test_areal()
TEST_UNION_REV(issue_566_a, 1, 0, -1, 214.3728);
TEST_UNION_REV(issue_566_b, 1, 0, -1, 214.3728);

{
// Without rescaling, the result is invalid
ut_settings settings;
settings.set_test_validity(BG_IF_RESCALED(true, false));
TEST_UNION_WITH(issue_838, 1, 0, -1, 1.3333);
}

{
// Rescaling produces an invalid result
ut_settings settings;
Expand Down

0 comments on commit e098a85

Please sign in to comment.