diff --git a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp index 9711119b045..0356defd69b 100644 --- a/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp +++ b/Intersections_3/test/Intersections_3/bbox_other_do_intersect_test.cpp @@ -322,6 +322,49 @@ void test_speed() speed("line"); } +template +bool intensive_test(bool exact_predicates = true) +{ + bool b = true; + + // Test vertical segments + for(double x = 4.; x <= 7.; x+=1.) + for(double ymin = 0.; ymin <= 7.; ymin+=1.) + for(double ymax = ymin; ymax <= 7.; ymax+=1.) + { + const bool expected = + x >= -5. && x<= 5. && + ymin <= 5. && ymax >= -5; + b &= test_case(x, ymin, 0., + x, ymax, 0., + -5., -5., -5., 5., 5., 5., expected); + } + // Test slanted segments + for(double x = -7.; x <= 6.; x+=1.) + for(double y = -1.; y <= 6.; y+=1.) + { + const bool expected = + x >= -6. && x <= 5. && + y >= -6. && y <= 5. && + y <= x + 10. && y >= x - 10.; + b &= test_case(x, y, 0., + x + 1., y + 1., 0., + -5., -5., -5., 5., 5., 5., expected); + } + for(double x = -9.; x <= 6.; x+=1.) + for(double y = -3.; y <= 6.; y+=1.) + { + const bool expected = + x >= -8. && x <= 5. && + y >= -7. && y <= 5. && + 3 * y <= 2 * x + 25. && 3 * y >= 2 * x - 25.; + b &= test_case(x, y, 0., + x + 3., y + 2., 0., + -5., -5., -5., 5., 5., 5., expected); + } + return b; +} + template bool test() { @@ -612,43 +655,44 @@ bool test() return b; } +template +bool test_kernel(bool exact_predicates = true, K k = K()) +{ + bool b = test() && + intensive_test(exact_predicates); + test_speed >(); + return b; +} + int main() { srand(0); std::cout << std::setprecision(5); std::cout << "Testing with Simple_cartesian..." << std::endl ; - bool b = test >(); - test_speed >(); + bool b = test_kernel >(false); std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; - b &= test >(); - test_speed >(); + b &= test_kernel >(false); std::cout << std::endl << "Testing with Simple_cartesian..." << std::endl ; - b &= test >(); - test_speed >(); + b &= test_kernel >(false); std::cout << std::endl << "Testing with Cartesian..." << std::endl ; - b &= test >(); - test_speed >(); + b &= test_kernel >(false); std::cout << std::endl << "Testing with Cartesian..." << std::endl ; - b &= test >(); - test_speed >(); + b &= test_kernel >(false); std::cout << std::endl << "Testing with Filtered_kernel > without static filters..." << std::endl ; typedef CGAL::Filtered_kernel, false> Fk_no_static; - b &= test(); - test_speed(); + b &= test_kernel(); std::cout << std::endl << "Testing with Exact_predicates_inexact_constructions_kernel..." << std::endl ; - b &= test(); - test_speed(); + b &= test_kernel(); std::cout << std::endl << "Testing with Exact_predicates_exact_constructions_kernel..." << std::endl ; - b &= test(); - test_speed(); + b &= test_kernel(); if ( b ) return EXIT_SUCCESS;