mirror of https://github.com/CGAL/cgal
Remove obsolete RT/FT tests
This commit is contained in:
parent
c93e33c731
commit
ae30bcf819
|
|
@ -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")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,94 +0,0 @@
|
|||
#define CGAL_NO_MPZF_DIVISION_OPERATOR 1
|
||||
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/double.h>
|
||||
|
||||
using SCK = CGAL::Simple_cartesian<double>;
|
||||
|
||||
struct Any {
|
||||
template <class T> operator const T&();
|
||||
};
|
||||
|
||||
template <typename Predicate>
|
||||
void check_pred() {
|
||||
std::cerr << std::is_invocable_v<Predicate, Any>;
|
||||
std::cerr << std::is_invocable_v<Predicate, Any, Any>;
|
||||
std::cerr << std::is_invocable_v<Predicate, Any, Any, Any>;
|
||||
std::cerr << std::is_invocable_v<Predicate, Any, Any, Any, Any>;
|
||||
std::cerr << std::is_invocable_v<Predicate, Any, Any, Any, Any, Any>;
|
||||
std::cerr << std::is_invocable_v<Predicate, Any, Any, Any, Any, Any, Any>;
|
||||
std::cerr << std::is_invocable_v<Predicate, Any, Any, Any, Any, Any, Any, Any>;
|
||||
std::cerr << std::is_invocable_v<Predicate, Any, Any, Any, Any, Any, Any, Any, Any>;
|
||||
|
||||
// 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<Predicate, Any, Any, Any, Any, Any, Any, Any, Any, Any>);
|
||||
static_assert(!std::is_invocable_v<Predicate, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any>);
|
||||
static_assert(!std::is_invocable_v<Predicate, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any>);
|
||||
static_assert(!std::is_invocable_v<Predicate, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any>);
|
||||
std::cerr << '\n';
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
#define CGAL_Kernel_pred(P, Pf) \
|
||||
std::cerr << #P << ": "; \
|
||||
check_pred<SCK::P>();
|
||||
#include <CGAL/Kernel/interface_macros.h>
|
||||
|
||||
// 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<SCK::Angle_3, Any, Any, Any>);
|
||||
static_assert(!std::is_invocable_v<SCK::Angle_3, Any, Any, Any, Any>); // AMBIGUOUS CALL
|
||||
static_assert(!std::is_invocable_v<SCK::Is_degenerate_2, Any>); // 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 ' <type>' classKernel_1_1(^(Construct|Compute|Assign)*).xml | sed 's/<ref[^>]*>//; s|</ref>||; 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&
|
||||
|
||||
*/
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#define CGAL_NO_MPZF_DIVISION_OPERATOR 1
|
||||
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Mpzf.h>
|
||||
|
||||
template <typename R>
|
||||
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<CGAL::Mpzf>());
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue