Skip to content

Commit

Permalink
test: verify failures and remove some rescaling remainings
Browse files Browse the repository at this point in the history
  • Loading branch information
barendgehrels committed Dec 9, 2024
1 parent a9c3a24 commit 54b300a
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 319 deletions.
4 changes: 0 additions & 4 deletions test/algorithms/buffer/buffer_countries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,6 @@ int test_main(int, char* [])
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
#endif

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
BoostGeometryWriteExpectedFailures(BG_NO_FAILURES, 2, BG_NO_FAILURES);
#endif

return 0;
}

6 changes: 0 additions & 6 deletions test/algorithms/buffer/buffer_linestring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,8 @@ void test_all()
// Having flat end
test_one<linestring, polygon>("for_collinear", for_collinear, join_round, end_flat, 68.561, 2.0);
test_one<linestring, polygon>("for_collinear", for_collinear, join_miter, end_flat, 72, 2.0);
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
test_one<linestring, polygon>("for_collinear2", for_collinear2, join_round, end_flat, 74.387, 2.0);
test_one<linestring, polygon>("for_collinear2", for_collinear2, join_miter, end_flat, 78.0, 2.0);
#endif

test_one<linestring, polygon>("curve", curve, join_round, end_flat, 58.1944, 5.0, settings, 3.0);
test_one<linestring, polygon>("curve", curve, join_miter, end_flat, 58.7371, 5.0, settings, 3.0);
Expand Down Expand Up @@ -470,9 +468,5 @@ int test_main(int, char* [])
test_invalid<true, bg::model::point<long double, 2, bg::cs::cartesian> >();
#endif

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
BoostGeometryWriteExpectedFailures(4, 11, 3);
#endif

return 0;
}
11 changes: 0 additions & 11 deletions test/algorithms/buffer/buffer_linestring_aimes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,6 @@ void test_aimes()
double const aimes_width = width / 1000000.0;
for (int i = 0; i < n; i++)
{
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
// There are 4 false positives
bool const possible_invalid = width == 18 && (i == 75 || i == 80 || i == 140);
settings.set_test_validity(! possible_invalid);
#endif
std::ostringstream name;
try
{
Expand Down Expand Up @@ -294,11 +289,5 @@ int test_main(int, char* [])

test_aimes<bg::model::point<default_test_type, 2, bg::cs::cartesian> >();

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
// Type float is not supported for these cases.
// Type double has (judging the svg) 4 false negatives for validity
BoostGeometryWriteExpectedFailures(0, 0, 0);
#endif

return 0;
}
21 changes: 6 additions & 15 deletions test/algorithms/buffer/buffer_multi_linestring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,12 @@ void test_all()
test_one<multi_linestring_type, polygon>("mysql_23023665_1_20",
mysql_23023665_1, join_round32, end_flat, 1, 1, 350.1135, 2.0);

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
{
// Cases (railway roads) still failing
ut_settings settings(10.0, false);
test_one<multi_linestring_type, polygon>("ticket_13444_1",
ticket_13444, join_round32, end_round32, 3, 0, 11801.7832, 1.0, settings);
test_one<multi_linestring_type, polygon>("ticket_13444_3",
ticket_13444, join_round32, end_round32, 3, 1, 34132.0882, 3.0, settings);
test_one<multi_linestring_type, polygon>("ticket_13444_5",
ticket_13444, join_round32, end_round32, 2, 1, 50525.1110, 5.0, settings);
}
#endif
test_one<multi_linestring_type, polygon>("ticket_13444_1",
ticket_13444, join_round32, end_round32, 3, 0, 11799.2681, 1.0);
test_one<multi_linestring_type, polygon>("ticket_13444_3",
ticket_13444, join_round32, end_round32, 3, 1, 34132.0882, 3.0);
test_one<multi_linestring_type, polygon>("ticket_13444_5",
ticket_13444, join_round32, end_round32, 2, 1, 50525.1110, 5.0);

{
// This issue was detected for CCW order and only CW is tested by default.
Expand Down Expand Up @@ -234,8 +228,5 @@ int test_main(int, char* [])
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
#endif

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
BoostGeometryWriteExpectedFailures(6, 9, 3);
#endif
return 0;
}
13 changes: 5 additions & 8 deletions test/algorithms/buffer/buffer_multi_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ void test_all()
test_one<multi_point_type, polygon>("simplex3", simplex, join, end_flat, 44.5619, 3.0);

test_one<multi_point_type, polygon>("three1", three, join, end_flat, 3.0 * expectation, 1.0);
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
// fails in CCW mode
test_one<multi_point_type, polygon>("three2", three, join, end_flat, 36.7528, 2.0);
#endif
{
// Is reported as invalid for in CCW mode: test validity only for clockwise
ut_settings const settings(ut_settings::default_tolerance, Clockwise);
test_one<multi_point_type, polygon>("three2", three, join, end_flat, 36.7528, 2.0, settings);
}
test_one<multi_point_type, polygon>("three19", three, join, end_flat, 33.6857, 1.9);
test_one<multi_point_type, polygon>("three21", three, join, end_flat, 39.6337, 2.1);
test_one<multi_point_type, polygon>("three3", three, join, end_flat, 65.5243, 3.0);
Expand Down Expand Up @@ -220,9 +221,5 @@ int test_main(int, char* [])
std::cout << "Skipping some tests in debug or unknown mode" << std::endl;
#endif

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
BoostGeometryWriteExpectedFailures(BG_NO_FAILURES);
#endif

return 0;
}
4 changes: 0 additions & 4 deletions test/algorithms/buffer/buffer_multi_polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,5 @@ int test_main(int, char* [])
test_all<true, bg::model::point<mp_test_type, 2, bg::cs::cartesian> >();
#endif

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
BoostGeometryWriteExpectedFailures(1, 3, 3);
#endif

return 0;
}
4 changes: 0 additions & 4 deletions test/algorithms/buffer/buffer_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,5 @@ int test_main(int, char* [])
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
#endif

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
BoostGeometryWriteExpectedFailures(BG_NO_FAILURES);
#endif

return 0;
}
4 changes: 0 additions & 4 deletions test/algorithms/buffer/buffer_polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,10 +955,6 @@ int test_main(int, char* [])
test_mixed<dpoint, dpoint, true, true, false, true>();
#endif

#if defined(BOOST_GEOMETRY_TEST_FAILURES)
BoostGeometryWriteExpectedFailures(1, 9, 1);
#endif

test_different();

return 0;
Expand Down
3 changes: 2 additions & 1 deletion test/algorithms/buffer/test_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ template<> struct EndTestProperties<boost::geometry::strategy::buffer::end_flat>

struct ut_settings : public ut_base_settings
{
explicit ut_settings(double tol = 0.01, bool val = true, int points = 88)
static constexpr double default_tolerance = 0.01;
explicit ut_settings(double tol = default_tolerance, bool val = true, int points = 88)
: ut_base_settings(val)
, tolerance(tol)
, points_per_circle(points)
Expand Down
6 changes: 3 additions & 3 deletions test/algorithms/check_validity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <boost/geometry/algorithms/is_valid.hpp>

template<typename Geometry>
inline bool input_is_valid(std::string const& case_id, std::string const& subcase,
inline bool is_input_valid(std::string const& case_id, std::string const& subcase,
Geometry const& geometry)
{
std::string message;
Expand All @@ -42,8 +42,8 @@ inline bool is_output_valid(Geometry const& geometry,
bool result = bg::is_valid(geometry, message);
if (! result && ignore_validity_on_invalid_input)
{
if (! input_is_valid(case_id, "a", g1)
|| ! input_is_valid(case_id, "b", g2))
if (! is_input_valid(case_id, "a", g1)
|| ! is_input_valid(case_id, "b", g2))
{
// Because input is invalid, output validity is ignored
result = true;
Expand Down
Loading

0 comments on commit 54b300a

Please sign in to comment.