From 2a3cb7b95173ba005e51c39f1edea886405a3baa Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 14 Apr 2017 14:40:52 +0200 Subject: [PATCH] [test][intersection][union] Add cases where all points of g1 are the same as some points of g2. --- test/algorithms/overlay/overlay_cases.hpp | 16 ++++++++++++++++ .../set_operations/intersection/intersection.cpp | 7 +++++++ test/algorithms/set_operations/union/union.cpp | 7 +++++++ 3 files changed, 30 insertions(+) diff --git a/test/algorithms/overlay/overlay_cases.hpp b/test/algorithms/overlay/overlay_cases.hpp index 474a40e3c..ffc1bbdfe 100644 --- a/test/algorithms/overlay/overlay_cases.hpp +++ b/test/algorithms/overlay/overlay_cases.hpp @@ -528,6 +528,22 @@ static std::string case_102[2] = "POLYGON((3 6,4 5,5 4,3 2,1 4,3 6),(4 5,3 4,3.5 3.5,4 4,4 5))" }; +static std::string case_103[2] = +{ + // intersection + // all points of [1] the same as some points of [0] + "POLYGON((0 0,0 1,1 1,1 0,0 0))", + "POLYGON((0 0,0 1,1 0,0 0))" +}; + +static std::string case_104[2] = +{ + // union in hole + // all points of [1] the same as some points of [0] + "POLYGON((0 0,0 10,10 10,10 0,0 0),(1 1,9 1,9 9,1 9,1 1))", + "POLYGON((1 1,1 9,9 9,9 1,1 1))" +}; + static std::string case_many_situations[2] = { "POLYGON((2 6,2 14,10 18,18 14,18 6,16 5,14 4,12 3,10 2,8 3,6 4,4 5,2 6))", "POLYGON((2 6,2 7,2 8,2 9,2 10,2 11,2 12,1 14" diff --git a/test/algorithms/set_operations/intersection/intersection.cpp b/test/algorithms/set_operations/intersection/intersection.cpp index 74ba334a9..2b7505688 100644 --- a/test/algorithms/set_operations/intersection/intersection.cpp +++ b/test/algorithms/set_operations/intersection/intersection.cpp @@ -339,6 +339,13 @@ void test_areal() case_102[0], case_102[1], 0, -1, 3.1875); + test_one("case_103", + case_103[0], case_103[1], + 1, -1, 0.5); + test_one("case_104", + case_104[0], case_104[1], + 0, -1, 0.0); + test_one("mysql_21964049", mysql_21964049[0], mysql_21964049[1], 0, -1, 0.0); diff --git a/test/algorithms/set_operations/union/union.cpp b/test/algorithms/set_operations/union/union.cpp index aa0155604..014e8256a 100644 --- a/test/algorithms/set_operations/union/union.cpp +++ b/test/algorithms/set_operations/union/union.cpp @@ -237,6 +237,13 @@ void test_areal() test_one("102", case_102[0], case_102[1], 1, 1, 17, 8.75); + test_one("103", + case_103[0], case_103[1], + 1, 0, 5, 1.0); + test_one("104", + case_104[0], case_104[1], + 1, 0, 5, 100.0); + /* test_one(102, simplex_normal[0], simplex_reversed[1],