From 48f367e68b018b84eae13bb4850280287f5ba925 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 20 Nov 2015 09:56:55 +0100 Subject: [PATCH] fix bug and improve testsuite --- BGL/include/CGAL/boost/graph/iterator.h | 2 +- BGL/test/BGL/test_circulator.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index 74867ba8db4..d97dcd1b4f9 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -524,7 +524,7 @@ public: {} Halfedge_around_source_circulator(halfedge_descriptor hd, const Graph& g) - : Halfedge_around_source_circulator::iterator_adaptor_(Halfedge_around_target_circulator(hd,g)), opp(g) + : Halfedge_around_source_circulator::iterator_adaptor_(Halfedge_around_target_circulator(opposite(hd,g),g)), opp(g) {} Halfedge_around_source_circulator(vertex_descriptor vd, const Graph& g) diff --git a/BGL/test/BGL/test_circulator.cpp b/BGL/test/BGL/test_circulator.cpp index b0ba2375fe8..1b8d69a5a20 100644 --- a/BGL/test/BGL/test_circulator.cpp +++ b/BGL/test/BGL/test_circulator.cpp @@ -67,8 +67,10 @@ int main(int, char* argv[]) { halfedge_around_target_circulator havc(hd,P), done(havc); - + vertex_descriptor vd = target(hd,P); do { + halfedge_descriptor hd2 = *havc; + assert(target(hd2,P) == vd); std::cout << get(CGAL::vertex_point, P, target(*havc,P)) << std::endl; ++havc; }while(havc != done); @@ -91,8 +93,10 @@ int main(int, char* argv[]) } { halfedge_around_source_circulator havc(hd,P), done(havc); - + vertex_descriptor vd = source(hd,P); do { + halfedge_descriptor hd2 = *havc; + assert(source(hd2,P) == vd); std::cout << get(CGAL::vertex_point, P, target(*havc,P)) << std::endl; ++havc; }while(havc != done); @@ -100,10 +104,11 @@ int main(int, char* argv[]) { halfedge_around_target_iterator vit, end; + vertex_descriptor vd = target(hd,P); boost::tie(vit,end) = halfedges_around_target(hd,P); - while(vit!= end) { halfedge_descriptor hd = *vit; + assert(target(hd,P) == vd); std::cout << get(CGAL::vertex_point, P, target(hd,P)) << std::endl; ++vit; }