|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80549 - trunk/libs/geometry/test_extensions/nsphere
From: bruno.lalande_at_[hidden]
Date: 2012-09-16 18:53:37
Author: bruno.lalande
Date: 2012-09-16 18:53:36 EDT (Sun, 16 Sep 2012)
New Revision: 80549
URL: http://svn.boost.org/trac/boost/changeset/80549
Log:
Fixed nsphere unit tests.
Text files modified:
trunk/libs/geometry/test_extensions/nsphere/access.cpp | 9 +++++--
trunk/libs/geometry/test_extensions/nsphere/circle.cpp | 11 +++++----
trunk/libs/geometry/test_extensions/nsphere/multi_within.cpp | 12 +++++++---
trunk/libs/geometry/test_extensions/nsphere/point_type.cpp | 41 ++-------------------------------------
4 files changed, 23 insertions(+), 50 deletions(-)
Modified: trunk/libs/geometry/test_extensions/nsphere/access.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/nsphere/access.cpp (original)
+++ trunk/libs/geometry/test_extensions/nsphere/access.cpp 2012-09-16 18:53:36 EDT (Sun, 16 Sep 2012)
@@ -16,8 +16,11 @@
#include <geometry_test_common.hpp>
-#include <boost/geometry/extensions/nsphere/core/access.hpp>
-#include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
+#include <boost/geometry/extensions/nsphere/nsphere.hpp>
+#include <boost/geometry/geometries/adapted/boost_tuple.hpp>
+#include <boost/geometry/geometries/adapted/c_array.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/tuple/tuple.hpp>
@@ -44,7 +47,7 @@
typedef typename bg::coordinate_type<P>::type coordinate_type;
// N-SPHERE, setting sphere center
- test_get_set<bg::nsphere<P, coordinate_type> >();
+ test_get_set<bg::model::nsphere<P, coordinate_type> >();
}
Modified: trunk/libs/geometry/test_extensions/nsphere/circle.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/nsphere/circle.cpp (original)
+++ trunk/libs/geometry/test_extensions/nsphere/circle.cpp 2012-09-16 18:53:36 EDT (Sun, 16 Sep 2012)
@@ -14,14 +14,15 @@
#include <boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp>
#include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
+#include <boost/geometry/algorithms/detail/assign_values.hpp>
#include <boost/geometry/core/cs.hpp>
-
#include <boost/geometry/geometries/point.hpp>
-#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
-#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/c_array.hpp>
#include <test_common/test_point.hpp>
+BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian)
+
namespace bg = boost::geometry;
@@ -124,7 +125,7 @@
check_nsphere(c1, 0, 0,0,0);
P center;
- bg::assign(center, 1, 2, 3);
+ bg::assign_values(center, 1, 2, 3);
bg::model::nsphere<P, T> c2(center, 4);
check_nsphere(c2, 4, 1,2,3);
}
@@ -142,7 +143,7 @@
bg::set_radius<0>(c, 5000);
check_nsphere(c, 5000, 5,50,500);
- bg::assign(c, 6, 60, 600);
+ bg::assign_values(c, 6, 60, 600);
check_nsphere(c, 5000, 6,60,600);
}
Modified: trunk/libs/geometry/test_extensions/nsphere/multi_within.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/nsphere/multi_within.cpp (original)
+++ trunk/libs/geometry/test_extensions/nsphere/multi_within.cpp 2012-09-16 18:53:36 EDT (Sun, 16 Sep 2012)
@@ -10,6 +10,7 @@
#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/algorithms/within.hpp>
+#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/geometries/ring.hpp>
@@ -18,15 +19,18 @@
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/multi/algorithms/within.hpp>
-#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+#include <boost/geometry/multi/core/point_type.hpp>
+#include <boost/geometry/multi/geometries/multi_geometries.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/extensions/nsphere/nsphere.hpp>
int test_main( int , char* [] )
{
typedef bg::model::d2::point_xy<double> gl_point;
- typedef bg::circle gl_circle;
+ typedef bg::model::nsphere<gl_point, double> gl_circle;
typedef bg::model::ring<gl_point> gl_ring;
typedef bg::model::polygon<gl_point> gl_polygon;
- typedef bg::multi_polygon<gl_polygon> gl_multi_polygon;
+ typedef bg::model::multi_polygon<gl_polygon> gl_multi_polygon;
gl_circle circle(gl_point(1, 1), 2.5);
@@ -43,7 +47,7 @@
multi_polygon.push_back(pol);
// Multipolygon in circle
- BOOST_CHECK_EQUAL(within(multi_polygon, circle), true);
+ BOOST_CHECK_EQUAL(bg::within(multi_polygon, circle), true);
return 0;
}
Modified: trunk/libs/geometry/test_extensions/nsphere/point_type.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/nsphere/point_type.cpp (original)
+++ trunk/libs/geometry/test_extensions/nsphere/point_type.cpp 2012-09-16 18:53:36 EDT (Sun, 16 Sep 2012)
@@ -10,17 +10,8 @@
#include <geometry_test_common.hpp>
-
-#include <boost/geometry/core/tag.hpp>
-
-#include <boost/geometry/geometries/geometries.hpp>
-
-#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
-#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
-
-
-#include <vector>
-#include <deque>
+#include <boost/geometry/extensions/nsphere/nsphere.hpp>
+#include <boost/geometry/multi/core/point_type.hpp>
template <typename G, typename Expected>
@@ -33,37 +24,11 @@
template <typename P>
void test_all()
{
- test_geometry<P, P>();
- test_geometry<const P, P>();
- test_geometry<bg::model::linestring<P> , P>();
- test_geometry<bg::model::ring<P> , P>();
- test_geometry<bg::model::polygon<P> , P>();
- test_geometry<bg::model::box<P> , P>();
- test_geometry<bg::segment<P> , P>();
- test_geometry<bg::segment<const P> , P>();
- test_geometry<bg::nsphere<P, double> , P>();
-
- test_geometry<std::vector<P>, P>();
- test_geometry<std::deque<P>, P>();
-
- test_geometry<boost::array<P, 5>, P>();
+ test_geometry<bg::model::nsphere<P, double> , P>();
}
int test_main(int, char* [])
{
- test_geometry<int[2], int[2]>();
- test_geometry<float[2], float[2]>();
- test_geometry<double[2], double[2]>();
-
- test_geometry<int[3], int[3]>();
- test_geometry<float[3], float[3]>();
- test_geometry<double[3], double[3]>();
-
- test_geometry<boost::tuple<double, double>,
- boost::tuple<double, double> >();
- test_geometry<boost::tuple<double, double, double>,
- boost::tuple<double, double, double> >();
-
test_all<bg::model::point<int, 2, bg::cs::cartesian> >();
test_all<bg::model::point<float, 2, bg::cs::cartesian> >();
test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
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