• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // Unit Test
3 
4 // Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
7 
8 // This file was modified by Oracle on 2014.
9 // Modifications copyright (c) 2014, Oracle and/or its affiliates.
10 
11 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
12 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
13 
14 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
15 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
16 
17 // Use, modification and distribution is subject to the Boost Software License,
18 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
19 // http://www.boost.org/LICENSE_1_0.txt)
20 
21 
22 #include <strategies/test_projected_point.hpp>
23 
24 
25 template <typename P1, typename P2>
test_all_2d()26 void test_all_2d()
27 {
28     test_2d<P1, P2>("POINT(1 1)", "POINT(0 0)", "POINT(2 3)", 0.27735203958327);
29     test_2d<P1, P2>("POINT(2 2)", "POINT(1 4)", "POINT(4 1)", 0.5 * sqrt(2.0));
30     test_2d<P1, P2>("POINT(6 1)", "POINT(1 4)", "POINT(4 1)", 2.0);
31     test_2d<P1, P2>("POINT(1 6)", "POINT(1 4)", "POINT(4 1)", 2.0);
32 }
33 
34 template <typename P>
test_all_2d()35 void test_all_2d()
36 {
37     //test_all_2d<P, int[2]>();
38     //test_all_2d<P, float[2]>();
39     //test_all_2d<P, double[2]>();
40     //test_all_2d<P, test::test_point>();
41     test_all_2d<P, bg::model::point<int, 2, bg::cs::cartesian> >();
42     test_all_2d<P, bg::model::point<float, 2, bg::cs::cartesian> >();
43     test_all_2d<P, bg::model::point<double, 2, bg::cs::cartesian> >();
44     test_all_2d<P, bg::model::point<long double, 2, bg::cs::cartesian> >();
45 }
46 
test_main(int,char * [])47 int test_main(int, char* [])
48 {
49     test_all_2d<int[2]>();
50     test_all_2d<float[2]>();
51     test_all_2d<double[2]>();
52     //test_all_2d<test::test_point>();
53 
54     test_all_2d<bg::model::point<int, 2, bg::cs::cartesian> >();
55     test_all_2d<bg::model::point<float, 2, bg::cs::cartesian> >();
56     test_all_2d<bg::model::point<double, 2, bg::cs::cartesian> >();
57 
58     test_services
59         <
60             bg::model::point<double, 2, bg::cs::cartesian>,
61             bg::model::point<float, 2, bg::cs::cartesian>,
62             long double
63         >();
64 
65 
66 #if defined(HAVE_TTMATH)
67     test_all_2d
68         <
69             bg::model::point<ttmath_big, 2, bg::cs::cartesian>,
70             bg::model::point<ttmath_big, 2, bg::cs::cartesian>
71         >();
72 #endif
73 
74     return 0;
75 }
76