From 2ca66acb56947c27f46a63d7460d5d97e131657c Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 23 Mar 2013 13:03:57 +0000 Subject: [PATCH] [geometry] pending commit, added check for within/disjoint, 3d boxes [SVN r83527] --- test/algorithms/disjoint.cpp | 19 +++++++++++++++++++ test/algorithms/within.cpp | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/test/algorithms/disjoint.cpp b/test/algorithms/disjoint.cpp index 862035005..51d12cf64 100644 --- a/test/algorithms/disjoint.cpp +++ b/test/algorithms/disjoint.cpp @@ -205,6 +205,22 @@ void test_all() } + +template +void test_3d() +{ + typedef bg::model::box

box; + + test_disjoint("pp 3d 1", "point(1 1 1)", "point(1 1 1)", false); + test_disjoint("pp 3d 2", "point(1 1 1)", "point(1.001 1 1)", true); + + test_disjoint("bb1", "box(1 1 1, 2 2 2)", "box(3 1 1, 4 2 1)", true); + test_disjoint("bb2", "box(1 1 1, 2 2 2)", "box(2 1 1, 3 2 1)", false); + test_disjoint("bb3", "box(1 1 1, 2 2 2)", "box(2 2 1, 3 3 1)", false); + test_disjoint("bb4", "box(1 1 1, 2 2 2)", "box(2.001 2 1, 3 3 1)", true); + +} + int test_main(int, char* []) { test_all >(); @@ -214,5 +230,8 @@ int test_main(int, char* []) test_all >(); #endif + test_3d >(); + + return 0; } diff --git a/test/algorithms/within.cpp b/test/algorithms/within.cpp index 15fee71f0..0a3d4df3f 100644 --- a/test/algorithms/within.cpp +++ b/test/algorithms/within.cpp @@ -151,6 +151,10 @@ void test_3d() 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