Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75783 - trunk/libs/geometry/test/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-12-03 05:27:26


Author: barendgehrels
Date: 2011-12-03 05:27:26 EST (Sat, 03 Dec 2011)
New Revision: 75783
URL: http://svn.boost.org/trac/boost/changeset/75783

Log:
Updated unit tests for convert (segment_to_segment, 3D cases)

Text files modified:
   trunk/libs/geometry/test/algorithms/convert.cpp | 42 ++++++++++++++++++++++++++++++++++++++++
   1 files changed, 42 insertions(+), 0 deletions(-)

Modified: trunk/libs/geometry/test/algorithms/convert.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/convert.cpp (original)
+++ trunk/libs/geometry/test/algorithms/convert.cpp 2011-12-03 05:27:26 EST (Sat, 03 Dec 2011)
@@ -30,6 +30,12 @@
             bg::model::box<Point2>
>("POLYGON((1 2,1 4,3 4,3 2,1 2))");
 
+ test_mixed_identical_result
+ <
+ bg::model::segment<Point1>,
+ bg::model::segment<Point2>
+ >("LINESTRING(1 1,2 2)");
+
     // Linestring
     test_mixed_identical_result
         <
@@ -222,12 +228,43 @@
 }
 
 template <typename Point1, typename Point2>
+void test_mixed_point_types_3d()
+{
+ // Point
+ test_mixed_identical_result<Point1, Point2>("POINT(1 2 3)");
+
+ test_mixed_identical_result
+ <
+ bg::model::segment<Point1>,
+ bg::model::segment<Point2>
+ >("LINESTRING(1 1 1,2 2 2)");
+
+ // Linestring
+ test_mixed_identical_result
+ <
+ bg::model::linestring<Point1>,
+ bg::model::linestring<Point2>
+ >
+ ("LINESTRING(1 1 1,2 2 2,3 3 3)");
+}
+
+
+
+template <typename Point1, typename Point2>
 void test_mixed_types()
 {
     test_mixed_point_types<Point1, Point2>();
     test_mixed_point_types<Point2, Point1>();
 }
 
+
+template <typename Point1, typename Point2>
+void test_mixed_types_3d()
+{
+ test_mixed_point_types_3d<Point1, Point2>();
+ test_mixed_point_types_3d<Point2, Point1>();
+}
+
 void test_array()
 {
     int a[2] = {1, 2};
@@ -249,6 +286,11 @@
             boost::tuple<float, float>,
             bg::model::point<float, 2, bg::cs::cartesian>
>();
+ test_mixed_types_3d
+ <
+ boost::tuple<double, double, double>,
+ bg::model::point<double, 3, bg::cs::cartesian>
+ >();
 
     test_array();
     return 0;


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