1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // Unit Test
3
4 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7
8 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
9 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
10
11 // Use, modification and distribution is subject to the Boost Software License,
12 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
13 // http://www.boost.org/LICENSE_1_0.txt)
14
15
16 #include <geometry_test_common.hpp>
17
18 #include <boost/geometry/core/reverse_dispatch.hpp>
19
20 #include <boost/geometry/geometries/geometries.hpp>
21
22
23
24 template <typename Geometry1, typename Geometry2, bool Expected>
test_reversed()25 void test_reversed()
26 {
27 BOOST_CHECK_EQUAL((bg::reverse_dispatch<Geometry1, Geometry2>::type::value),
28 Expected);
29 }
30
31
32 template <typename P>
test_all()33 void test_all()
34 {
35
36 test_reversed<P, P, false>();
37 test_reversed<P, bg::model::linestring<P>, false>();
38 test_reversed<bg::model::linestring<P>, P, true>();
39 test_reversed<bg::model::ring<P>, P, true>();
40 test_reversed<bg::model::linestring<P>, bg::model::ring<P>, false>();
41 test_reversed<bg::model::ring<P>, bg::model::linestring<P>, true>();
42 }
43
44 template <typename P1, typename P2>
test_mixed()45 void test_mixed()
46 {
47 test_reversed<P1, P2, false>();
48 }
49
50
test_main(int,char * [])51 int test_main(int, char* [])
52 {
53 test_all<bg::model::point<int, 2, bg::cs::cartesian> >();
54 test_mixed
55 <
56 bg::model::point<int, 2, bg::cs::cartesian>,
57 bg::model::point<int, 2, bg::cs::spherical<bg::degree> >
58 >();
59 test_mixed
60 <
61 bg::model::point<int, 2, bg::cs::spherical<bg::degree> >,
62 bg::model::point<int, 2, bg::cs::spherical<bg::radian> >
63 >();
64 return 0;
65 }
66