Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70669 - trunk/libs/geometry/test/algorithms/overlay
From: barend.gehrels_at_[hidden]
Date: 2011-03-28 15:12:10


Author: barendgehrels
Date: 2011-03-28 15:12:09 EDT (Mon, 28 Mar 2011)
New Revision: 70669
URL: http://svn.boost.org/trac/boost/changeset/70669

Log:
Updated test select_rings to support pathscale 4.0.8 (seems not accepting tuple_list_of)
Text files modified:
   trunk/libs/geometry/test/algorithms/overlay/select_rings.cpp | 71 ++++++++++++++++++++++++++++++++-------
   1 files changed, 58 insertions(+), 13 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/overlay/select_rings.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/overlay/select_rings.cpp (original)
+++ trunk/libs/geometry/test/algorithms/overlay/select_rings.cpp 2011-03-28 15:12:09 EDT (Mon, 28 Mar 2011)
@@ -23,8 +23,17 @@
 
 
 
-template <typename Geometry1, typename Geometry2, bg::overlay_type OverlayType, typename Vector>
-void test_geometry(std::string const& wkt1, std::string const& wkt2, Vector const& expected)
+template
+<
+ typename Geometry1,
+ typename Geometry2,
+ bg::overlay_type OverlayType,
+ typename RingIdVector,
+ typename WithinVector
+>
+void test_geometry(std::string const& wkt1, std::string const& wkt2,
+ RingIdVector const& expected_ids,
+ WithinVector const& expected_withins)
 {
     typedef bg::detail::overlay::ring_properties<typename bg::point_type<Geometry1>::type> properties;
 
@@ -40,18 +49,20 @@
 
     bg::detail::overlay::select_rings<OverlayType>(geometry1, geometry2, empty, selected);
 
- BOOST_CHECK_EQUAL(selected.size(), expected.size());
+ BOOST_CHECK_EQUAL(selected.size(), expected_ids.size());
+ BOOST_CHECK_EQUAL(selected.size(), expected_withins.size());
 
- if (selected.size() <= expected.size())
+ if (selected.size() <= expected_ids.size())
     {
- BOOST_AUTO(eit, expected.begin());
- for(typename map_type::const_iterator it = selected.begin(); it != selected.end(); ++it, ++eit)
+ BOOST_AUTO(eit, expected_ids.begin());
+ BOOST_AUTO(wit, expected_withins.begin());
+ for(typename map_type::const_iterator it = selected.begin(); it != selected.end(); ++it, ++eit, ++wit)
         {
             bg::ring_identifier const ring_id = it->first;
- BOOST_CHECK_EQUAL(ring_id.source_index, eit->template get<0>());
- BOOST_CHECK_EQUAL(ring_id.multi_index, eit->template get<1>());
- BOOST_CHECK_EQUAL(ring_id.ring_index, eit->template get<2>());
- BOOST_CHECK_EQUAL(it->second.within_code, eit->template get<3>());
+ BOOST_CHECK_EQUAL(ring_id.source_index, eit->source_index);
+ BOOST_CHECK_EQUAL(ring_id.multi_index, eit->multi_index);
+ BOOST_CHECK_EQUAL(ring_id.ring_index, eit->ring_index);
+ BOOST_CHECK_EQUAL(it->second.within_code, *wit);
         }
     }
 }
@@ -63,12 +74,46 @@
 void test_all()
 {
     // Point in correct clockwise ring -> should return true
+ typedef bg::ring_identifier rid;
+
     test_geometry<bg::model::polygon<P>, bg::model::polygon<P>, bg::overlay_union>(
- winded[0], winded[1],
- boost::assign::tuple_list_of(0,-1,-1,-1)(0,-1,0,-1)(0,-1,1,-1)(0,-1,3,-1)(1,-1,1,-1)(1,-1,2,-1));
+ winded[0], winded[1],
+ boost::assign::list_of
+ (rid(0,-1,-1))
+ (rid(0,-1, 0))
+ (rid(0,-1, 1))
+ (rid(0,-1, 3))
+ (rid(1,-1, 1))
+ (rid(1,-1, 2)),
+
+ boost::assign::list_of
+ (-1)
+ (-1)
+ (-1)
+ (-1)
+ (-1)
+ (-1)
+ );
+
+ //boost::assign::tuple_list_of(0,-1,-1,-1)(0,-1,0,-1)(0,-1,1,-1)(0,-1,3,-1)(1,-1,1,-1)(1,-1,2,-1));
+
     test_geometry<bg::model::polygon<P>, bg::model::polygon<P>, bg::overlay_intersection>(
             winded[0], winded[1],
- boost::assign::tuple_list_of(0,-1,2,1)(1,-1,-1,1)(1,-1,0,1)(1,-1,3,1));
+ boost::assign::list_of
+ (rid(0,-1, 2))
+ (rid(1,-1,-1))
+ (rid(1,-1, 0))
+ (rid(1,-1, 3)),
+
+ boost::assign::list_of
+ (1)
+ (1)
+ (1)
+ (1)
+ );
+
+
+ //boost::assign::tuple_list_of(0,-1,2,1)(1,-1,-1,1)(1,-1,0,1)(1,-1,3,1));
 }
 
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk