Skip to content

Commit 0050309

Browse files
committed
Add one LCC test
1 parent 72aa1a1 commit 0050309

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ target_compile_definitions(test_polyhedron_3_alias PRIVATE CGAL_NO_DEPRECATION_W
4747

4848
create_single_source_cgal_program(test_plane_graph_alias.cpp ${hfiles})
4949
target_compile_definitions(test_plane_graph_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS)
50+
51+
create_single_source_cgal_program(lcc_test_hook_operator.cpp)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
2+
3+
struct Items_index: public CGAL::Linear_cell_complex_min_items
4+
{ using Use_index=CGAL::Tag_true; };
5+
6+
template<typename LCC>
7+
bool test_lcc()
8+
{
9+
LCC lcc;
10+
typename LCC::Dart_descriptor dd;
11+
for(int i=0; i<10; ++i)
12+
{
13+
typename LCC::Dart_descriptor cur=lcc.create_dart();
14+
if(lcc.dart_descriptor(lcc.darts()[lcc.darts().index(cur)])!=cur)
15+
{ return false; }
16+
}
17+
18+
return true;
19+
}
20+
21+
int main()
22+
{
23+
using LCC2=CGAL::Linear_cell_complex_for_combinatorial_map<2,2>;
24+
using LCC2_INDEX=CGAL::Linear_cell_complex_for_combinatorial_map
25+
<2,2,CGAL::Linear_cell_complex_traits<2>, Items_index>;
26+
27+
if(!test_lcc<LCC2>() || !test_lcc<LCC2_INDEX>())
28+
{
29+
std::cout<<"ERROR lcc_test_hook_operator."<<std::endl;
30+
return EXIT_FAILURE;
31+
}
32+
33+
return EXIT_SUCCESS;
34+
}

0 commit comments

Comments
 (0)