|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83527 - trunk/libs/geometry/test/algorithms
From: barend.gehrels_at_[hidden]
Date: 2013-03-23 09:03:57
Author: barendgehrels
Date: 2013-03-23 09:03:57 EDT (Sat, 23 Mar 2013)
New Revision: 83527
URL: http://svn.boost.org/trac/boost/changeset/83527
Log:
[geometry] pending commit, added check for within/disjoint, 3d boxes
Text files modified:
trunk/libs/geometry/test/algorithms/disjoint.cpp | 19 +++++++++++++++++++
trunk/libs/geometry/test/algorithms/within.cpp | 4 ++++
2 files changed, 23 insertions(+), 0 deletions(-)
Modified: trunk/libs/geometry/test/algorithms/disjoint.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/disjoint.cpp (original)
+++ trunk/libs/geometry/test/algorithms/disjoint.cpp 2013-03-23 09:03:57 EDT (Sat, 23 Mar 2013)
@@ -205,6 +205,22 @@
}
+
+template <typename P>
+void test_3d()
+{
+ typedef bg::model::box<P> box;
+
+ test_disjoint<P, P>("pp 3d 1", "point(1 1 1)", "point(1 1 1)", false);
+ test_disjoint<P, P>("pp 3d 2", "point(1 1 1)", "point(1.001 1 1)", true);
+
+ test_disjoint<box, box>("bb1", "box(1 1 1, 2 2 2)", "box(3 1 1, 4 2 1)", true);
+ test_disjoint<box, box>("bb2", "box(1 1 1, 2 2 2)", "box(2 1 1, 3 2 1)", false);
+ test_disjoint<box, box>("bb3", "box(1 1 1, 2 2 2)", "box(2 2 1, 3 3 1)", false);
+ test_disjoint<box, box>("bb4", "box(1 1 1, 2 2 2)", "box(2.001 2 1, 3 3 1)", true);
+
+}
+
int test_main(int, char* [])
{
test_all<bg::model::d2::point_xy<float> >();
@@ -214,5 +230,8 @@
test_all<bg::model::d2::point_xy<ttmath_big> >();
#endif
+ test_3d<bg::model::point<double, 3, bg::cs::cartesian> >();
+
+
return 0;
}
Modified: trunk/libs/geometry/test/algorithms/within.cpp
==============================================================================
--- trunk/libs/geometry/test/algorithms/within.cpp (original)
+++ trunk/libs/geometry/test/algorithms/within.cpp 2013-03-23 09:03:57 EDT (Sat, 23 Mar 2013)
@@ -151,6 +151,10 @@
BOOST_CHECK_EQUAL(bg::within(point_type(2, 4, 2), box), false);
BOOST_CHECK_EQUAL(bg::within(point_type(2, 2, 4), box), false);
BOOST_CHECK_EQUAL(bg::within(point_type(2, 2, 5), box), false);
+
+ box_type box2(point_type(2, 2, 2), point_type(3, 3, 3));
+ BOOST_CHECK_EQUAL(bg::within(box2, box), false);
+
}
template <typename P1, typename P2>
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