mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[test][overlaps] Group the tests in separate files.
This commit is contained in:
parent
7422c6c400
commit
e660e9fb19
@ -22,12 +22,12 @@ test-suite boost-geometry-algorithms-relational
|
||||
[ run equals.cpp : : : : algorithms_equals ]
|
||||
[ run equals_multi.cpp : : : : algorithms_equals_multi ]
|
||||
[ run equals_on_spheroid.cpp : : : : algorithms_equals_on_spheroid ]
|
||||
[ run overlaps.cpp : : : : algorithms_overlaps ]
|
||||
[ run touches.cpp : : : : algorithms_touches ]
|
||||
[ run touches_multi.cpp : : : : algorithms_touches_multi ]
|
||||
;
|
||||
|
||||
build-project disjoint ;
|
||||
build-project intersects ;
|
||||
build-project overlaps ;
|
||||
build-project relate ;
|
||||
build-project within ;
|
||||
|
23
test/algorithms/relational_operations/overlaps/Jamfile.v2
Normal file
23
test/algorithms/relational_operations/overlaps/Jamfile.v2
Normal file
@ -0,0 +1,23 @@
|
||||
# Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
#
|
||||
# Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
# Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
|
||||
# Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
|
||||
#
|
||||
# This file was modified by Oracle on 2014, 2015.
|
||||
# Modifications copyright (c) 2014-2015, Oracle and/or its affiliates.
|
||||
#
|
||||
# Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
# Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
#
|
||||
# Use, modification and distribution is subject to the Boost Software License,
|
||||
# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
test-suite boost-geometry-algorithms-relational-overlaps
|
||||
:
|
||||
[ run overlaps.cpp : : : : algorithms_overlaps ]
|
||||
[ run overlaps_areal.cpp : : : : algorithms_overlaps_areal ]
|
||||
[ run overlaps_box.cpp : : : : algorithms_overlaps_box ]
|
||||
;
|
||||
|
56
test/algorithms/relational_operations/overlaps/overlaps.cpp
Normal file
56
test/algorithms/relational_operations/overlaps/overlaps.cpp
Normal file
@ -0,0 +1,56 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "test_overlaps.hpp"
|
||||
|
||||
template <typename P>
|
||||
void test_pp()
|
||||
{
|
||||
typedef bg::model::multi_point<P> mpt;
|
||||
|
||||
test_geometry<mpt, mpt>("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,3 3,4 4)", true);
|
||||
test_geometry<mpt, mpt>("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,2 2)", false);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_ll()
|
||||
{
|
||||
typedef bg::model::linestring<P> ls;
|
||||
typedef bg::model::multi_linestring<ls> mls;
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 2,3 1)", "LINESTRING(1 1,2 2,4 4)", true);
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 2,4 0)", "LINESTRING(0 1,2 1,3 2)", false);
|
||||
|
||||
test_geometry<ls, mls>("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(2 2,4 4))", true);
|
||||
test_geometry<ls, mls>("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(3 3,4 4))", true);
|
||||
test_geometry<ls, mls>("LINESTRING(0 0,3 3,3 1)", "MULTILINESTRING((3 3,2 2),(0 0,1 1))", false);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_2d()
|
||||
{
|
||||
test_pp<P>();
|
||||
test_ll<P>();
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
{
|
||||
test_2d<bg::model::d2::point_xy<int> >();
|
||||
test_2d<bg::model::d2::point_xy<double> >();
|
||||
|
||||
#if defined(HAVE_TTMATH)
|
||||
test_2d<bg::model::d2::point_xy<ttmath_big> >();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
@ -13,59 +13,6 @@
|
||||
|
||||
#include "test_overlaps.hpp"
|
||||
|
||||
template <typename P>
|
||||
void test_box_box_2d()
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_COMPILE_FAIL)
|
||||
test_geometry<P, P>("POINT(1 1)", "POINT(1 1)", true);
|
||||
#endif
|
||||
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 3 3)", "BOX(0 0,2 2)", true);
|
||||
|
||||
// touch -> false
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 3 3)", "BOX(3 3,5 5)", false);
|
||||
|
||||
// disjoint -> false
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 3 3)", "BOX(4 4,6 6)", false);
|
||||
|
||||
// within -> false
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 5 5)", "BOX(2 2,3 3)", false);
|
||||
|
||||
// within+touch -> false
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 5 5)", "BOX(2 2,5 5)", false);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_3d()
|
||||
{
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(0 0 0,2 2 2)", true);
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(3 3 3,5 5 5)", false);
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(4 4 4,6 6 6)", false);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_pp()
|
||||
{
|
||||
typedef bg::model::multi_point<P> mpt;
|
||||
|
||||
test_geometry<mpt, mpt>("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,3 3,4 4)", true);
|
||||
test_geometry<mpt, mpt>("MULTIPOINT(0 0,1 1,2 2)", "MULTIPOINT(1 1,2 2)", false);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_ll()
|
||||
{
|
||||
typedef bg::model::linestring<P> ls;
|
||||
typedef bg::model::multi_linestring<ls> mls;
|
||||
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 2,3 1)", "LINESTRING(1 1,2 2,4 4)", true);
|
||||
test_geometry<ls, ls>("LINESTRING(0 0,2 2,4 0)", "LINESTRING(0 1,2 1,3 2)", false);
|
||||
|
||||
test_geometry<ls, mls>("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(2 2,4 4))", true);
|
||||
test_geometry<ls, mls>("LINESTRING(0 0,2 2,3 1)", "MULTILINESTRING((1 1,2 2),(3 3,4 4))", true);
|
||||
test_geometry<ls, mls>("LINESTRING(0 0,3 3,3 1)", "MULTILINESTRING((3 3,2 2),(0 0,1 1))", false);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_aa()
|
||||
{
|
||||
@ -102,11 +49,7 @@ void test_aa()
|
||||
template <typename P>
|
||||
void test_2d()
|
||||
{
|
||||
test_pp<P>();
|
||||
test_ll<P>();
|
||||
test_aa<P>();
|
||||
|
||||
test_box_box_2d<P>();
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
@ -118,7 +61,5 @@ int test_main( int , char* [] )
|
||||
test_2d<bg::model::d2::point_xy<ttmath_big> >();
|
||||
#endif
|
||||
|
||||
//test_3d<bg::model::point<double, 3, bg::cs::cartesian> >();
|
||||
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "test_overlaps.hpp"
|
||||
|
||||
template <typename P>
|
||||
void test_box_box_2d()
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_COMPILE_FAIL)
|
||||
test_geometry<P, P>("POINT(1 1)", "POINT(1 1)", true);
|
||||
#endif
|
||||
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 3 3)", "BOX(0 0,2 2)", true);
|
||||
|
||||
// touch -> false
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 3 3)", "BOX(3 3,5 5)", false);
|
||||
|
||||
// disjoint -> false
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 3 3)", "BOX(4 4,6 6)", false);
|
||||
|
||||
// within -> false
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 5 5)", "BOX(2 2,3 3)", false);
|
||||
|
||||
// within+touch -> false
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1, 5 5)", "BOX(2 2,5 5)", false);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_3d()
|
||||
{
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(0 0 0,2 2 2)", true);
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(3 3 3,5 5 5)", false);
|
||||
test_geometry<bg::model::box<P>, bg::model::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(4 4 4,6 6 6)", false);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void test_2d()
|
||||
{
|
||||
test_box_box_2d<P>();
|
||||
}
|
||||
|
||||
int test_main( int , char* [] )
|
||||
{
|
||||
test_2d<bg::model::d2::point_xy<int> >();
|
||||
test_2d<bg::model::d2::point_xy<double> >();
|
||||
|
||||
#if defined(HAVE_TTMATH)
|
||||
test_2d<bg::model::d2::point_xy<ttmath_big> >();
|
||||
#endif
|
||||
|
||||
//test_3d<bg::model::point<double, 3, bg::cs::cartesian> >();
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user