From ae30bcf8190e11d60706846b6dea5fb7b2aea7a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 22 Sep 2022 12:25:25 +0200 Subject: [PATCH] Remove obsolete RT/FT tests --- Kernel_23/test/Kernel_23/CMakeLists.txt | 2 - .../kernel_detect_predicates_arity.cpp | 94 ------------------- .../test/Kernel_23/test_predicate_with_RT.cpp | 35 ------- 3 files changed, 131 deletions(-) delete mode 100644 Kernel_23/test/Kernel_23/kernel_detect_predicates_arity.cpp delete mode 100644 Kernel_23/test/Kernel_23/test_predicate_with_RT.cpp diff --git a/Kernel_23/test/Kernel_23/CMakeLists.txt b/Kernel_23/test/Kernel_23/CMakeLists.txt index c194a833079..4f1021c49c4 100644 --- a/Kernel_23/test/Kernel_23/CMakeLists.txt +++ b/Kernel_23/test/Kernel_23/CMakeLists.txt @@ -15,7 +15,6 @@ create_single_source_cgal_program("Homogeneous.cpp") create_single_source_cgal_program("issue_129.cpp") create_single_source_cgal_program("issue_3301.cpp") create_single_source_cgal_program("Kernel_checker.cpp") -create_single_source_cgal_program("kernel_detect_predicates_arity.cpp") create_single_source_cgal_program("Lazy_kernel.cpp") create_single_source_cgal_program("origin_3.cpp") create_single_source_cgal_program("overload_bug.cpp") @@ -29,7 +28,6 @@ create_single_source_cgal_program("test_converter.cpp") create_single_source_cgal_program("test_Has_conversion.cpp") create_single_source_cgal_program("test_hash_functions.cpp") create_single_source_cgal_program("test_kernel__.cpp") -create_single_source_cgal_program("test_predicate_with_RT.cpp") create_single_source_cgal_program("test_projection_traits.cpp") create_single_source_cgal_program("test_Projection_traits_xy_3_Intersect_2.cpp") diff --git a/Kernel_23/test/Kernel_23/kernel_detect_predicates_arity.cpp b/Kernel_23/test/Kernel_23/kernel_detect_predicates_arity.cpp deleted file mode 100644 index aca12aa1b2a..00000000000 --- a/Kernel_23/test/Kernel_23/kernel_detect_predicates_arity.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#define CGAL_NO_MPZF_DIVISION_OPERATOR 1 - -#include -#include - -using SCK = CGAL::Simple_cartesian; - -struct Any { - template operator const T&(); -}; - -template -void check_pred() { - std::cerr << std::is_invocable_v; - std::cerr << std::is_invocable_v; - std::cerr << std::is_invocable_v; - std::cerr << std::is_invocable_v; - std::cerr << std::is_invocable_v; - std::cerr << std::is_invocable_v; - std::cerr << std::is_invocable_v; - std::cerr << std::is_invocable_v; - - // The following asserts that no predicate from the kernel has more than - // 8 arguments (actually the assertions are only from 9 to 12 arguments). - static_assert(!std::is_invocable_v); - static_assert(!std::is_invocable_v); - static_assert(!std::is_invocable_v); - static_assert(!std::is_invocable_v); - std::cerr << '\n'; -} - -int main() -{ -#define CGAL_Kernel_pred(P, Pf) \ - std::cerr << #P << ": "; \ - check_pred(); -#include - - // Bug with predicates with multiple overload of the call operator with the - // same number of arguments: the call with `Any` is ambiguous. - static_assert(std::is_invocable_v); - static_assert(!std::is_invocable_v); // AMBIGUOUS CALL - static_assert(!std::is_invocable_v); // AMBIGUOUS CALL - return 0; -} - - -/* - -WORK IN PROGRESS: - -In the CGAL Kernel: - - 2D: 49 predicates - - 3D: 50 predicates - - -## Try to detect all possible types of arguments of predicates, from the doc - -``` -[lrineau@fernand]~/Git/cgal-master/build-doc/doc_output/Kernel_23/xml% grep -h ' ' classKernel_1_1(^(Construct|Compute|Assign)*).xml | sed 's/]*>//; s|||; s| &|\&|' | sed 's/Kernel::/K::/'| sort | uniq -c | sort -n | grep -v _3 -``` - -3D: (14 types of arguments) - -const K::Direction_3& -const K::Triangle_3& -const K::Circle_3& -const K::Ray_3& -const K::Segment_3& -const K::Iso_cuboid_3& -const K::Line_3& -const K::Tetrahedron_3& -const K::FT& -const K::Plane_3& -const K::Sphere_3& -const K::Vector_3& -const K::Weighted_point_3& -const K::Point_3& - -2D: (10 types arguments) - -const K::Vector_2& -const K::Direction_2& -const K::Iso_rectangle_2& -const K::Ray_2& -const K::Circle_2& -const K::Triangle_2& -const K::FT& -const K::Segment_2& -const K::Weighted_point_2& -const K::Line_2& -const K::Point_2& - -*/ diff --git a/Kernel_23/test/Kernel_23/test_predicate_with_RT.cpp b/Kernel_23/test/Kernel_23/test_predicate_with_RT.cpp deleted file mode 100644 index 68b833ece67..00000000000 --- a/Kernel_23/test/Kernel_23/test_predicate_with_RT.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#define CGAL_NO_MPZF_DIVISION_OPERATOR 1 - -#include -#include - -template -void test(const R& rep) { - using Point_3 = typename R::Point_3; - using Segment_3 = typename R::Segment_3; - using Line_3 = typename R::Line_3; - - auto construct_point = rep.construct_point_3_object(); - Point_3 p2 = construct_point(CGAL::ORIGIN); - Point_3 p3 = construct_point(1,1,1); - Point_3 p4 = construct_point(1,1,2); - Point_3 p5 = construct_point(1,2,3); - Point_3 p6 = construct_point(4,2,1); - - auto construct_segment = rep.construct_segment_3_object(); - Segment_3 s2 = construct_segment(p2,p3), s1 = s2; - - auto construct_line = rep.construct_line_3_object(); - Line_3 l2 = construct_line(p5,p6); - - auto compare_distance = rep.compare_distance_3_object(); - // compare_distance(p2, p2, p2); - compare_distance(p2, s2, p2); - // compare_distance(p2, l2, p2); -} - -int main() -{ - test(CGAL::Simple_cartesian()); - return 0; -}