From a2d2d4f58df1dfc90f9cc5c3440ddabdee484596 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 1 Nov 2015 12:27:08 +0100 Subject: [PATCH] [test] remove overload with percentage, only used once and now supported by ut_settings --- .../set_operations/union/test_union.hpp | 20 ++----------- .../algorithms/set_operations/union/union.cpp | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/test/algorithms/set_operations/union/test_union.hpp b/test/algorithms/set_operations/union/test_union.hpp index dd5893d86..67ef15b19 100644 --- a/test/algorithms/set_operations/union/test_union.hpp +++ b/test/algorithms/set_operations/union/test_union.hpp @@ -210,7 +210,7 @@ void test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, int expected_count, int expected_hole_count, int expected_point_count, double expected_area, - ut_settings const& settings) + ut_settings const& settings = ut_settings()) { G1 g1; bg::read_wkt(wkt1, g1); @@ -218,7 +218,7 @@ void test_one(std::string const& caseid, G2 g2; bg::read_wkt(wkt2, g2); - // Reverse if necessary + // Reverse/close if necessary (e.g. G1/G2 are ccw and/or open) bg::correct(g1); bg::correct(g2); @@ -227,20 +227,4 @@ void test_one(std::string const& caseid, expected_area, settings); } -template -void test_one(std::string const& caseid, - std::string const& wkt1, std::string const& wkt2, - int expected_count, int expected_hole_count, - int expected_point_count, double expected_area, - double percentage = 0.001) -{ - ut_settings settings; - settings.percentage = percentage; - - test_one(caseid, wkt1, wkt2, - expected_count, expected_hole_count, expected_point_count, - expected_area, settings); -} - - #endif diff --git a/test/algorithms/set_operations/union/union.cpp b/test/algorithms/set_operations/union/union.cpp index b9826830a..88090c136 100644 --- a/test/algorithms/set_operations/union/union.cpp +++ b/test/algorithms/set_operations/union/union.cpp @@ -247,16 +247,20 @@ void test_areal() 67.3550722317627); #endif + { + ut_settings settings; + settings.percentage = 0.1; - test_one("isovist", - isovist1[0], isovist1[1], - 1, - 0, - -1, - 313.36036462, 0.1); + test_one("isovist", + isovist1[0], isovist1[1], + 1, + 0, + -1, + 313.36036462, settings); - // SQL Server gives: 313.360374193241 - // PostGIS gives: 313.360364623393 + // SQL Server gives: 313.360374193241 + // PostGIS gives: 313.360364623393 + } // Ticket 5103 https://svn.boost.org/trac/boost/ticket/5103 // This ticket was actually reported for Boost.Polygon @@ -266,10 +270,13 @@ void test_areal() // Boost.Geometry gives: 2515271327070.5237746891 (ttmath) // 2515271327070.5156 (double) // 2515271320603.0000 (int) - // Note the int-test was tested outside of this unit test. It is in two points 0.37 off (logical for an int). - // Because of the width of the polygon (400000 meter) this causes a substantial difference. + // Note the int-test was tested outside of this unit test. + // It is in two points 0.37 off (logical for an int). + // Because of the width of the polygon (400000 meter) + // this causes a substantial difference. - test_one("ticket_5103", ticket_5103[0], ticket_5103[1], + test_one("ticket_5103", + ticket_5103[0], ticket_5103[1], 1, 0, 25, 2515271327070.5); test_one("ticket_8310a", ticket_8310a[0], ticket_8310a[1],