diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index 40c55d26c66..434123fcdd2 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -481,6 +481,27 @@ struct Test check_intersection (S(p( -1,-1), p( -2,-2)), S(p(-2,-2), p(-1,-1)), S(p(-2,-2),p(-1,-1))); check_intersection (S(p( -2,-2), p( -1,-1)), S(p(-1,-1), p(-2,-2)), S(p(-2,-2),p(-1,-1))); check_intersection (S(p( -2,-2), p( -1,-1)), S(p(-2,-2), p(-1,-1)), S(p(-2,-2),p(-1,-1))); + + //check determinism of crossing point + P p1a(-122.37323046264295, 37.7435274415764); + P p1b(-122.3711959178425, 37.74348027376899); + P p2a(-122.37130249711004, 37.74203327688176); + P p2b(-122.3722247426892, 37.74401427059434); + std::set ds; + auto test = [&ds](S s1, S s2) + { + P i = boost::get

(*CGAL::intersection(s1,s2)); + ds.insert(CGAL::to_double(i.x())); ds.insert(CGAL::to_double(i.y())); + assert(ds.size()==2); + }; + test(S(p1a,p1b), S(p2a,p2b)); + test(S(p1a,p1b), S(p2b,p2a)); + test(S(p1b,p1a), S(p2b,p2a)); + test(S(p1b,p1a), S(p2a,p2b)); + test(S(p2a,p2b), S(p1a,p1b)); + test(S(p2b,p2a), S(p1a,p1b)); + test(S(p2b,p2a), S(p1b,p1a)); + test(S(p2a,p2b), S(p1b,p1a)); } void R_R()