// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2011 Bruno Lalande, Paris, France. // Copyright (c) 2009-2011 Mateusz Loskot, London, UK. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. // 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) #ifndef GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP #define GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP #if defined(_MSC_VER) // We deliberately mix float/double's so turn off warnings #pragma warning( disable : 4244 ) // For (new since Boost 1.40) warning in Boost.Test on putenv/posix #pragma warning( disable : 4996 ) //#pragma warning( disable : 4305 ) #endif // defined(_MSC_VER) #include #if defined(BOOST_INTEL_CXX_VERSION) #define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE #endif #include // Include some always-included-for-testing files #if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST) # include # include //# include # include #endif #if defined(HAVE_TTMATH) # include #endif #if defined(HAVE_CLN) || defined(HAVE_GMP) # include #endif #if defined(HAVE_GMP) # include #endif #if defined(HAVE_CLN) # include #endif template struct string_from_type {}; template <> struct string_from_type { static std::string name() { return "v"; } }; template <> struct string_from_type { static std::string name() { return "f"; } }; template <> struct string_from_type { static std::string name() { return "d"; } }; template <> struct string_from_type { static std::string name() { return "e"; } }; #if defined(HAVE_TTMATH) template <> struct string_from_type { static std::string name() { return "t"; } }; #endif #if defined(HAVE_GMP) template <> struct string_from_type { static std::string name() { return "g"; } }; #endif #if defined(HAVE_CLN) template <> struct string_from_type { static std::string name() { return "c"; } }; #endif template inline T if_typed_tt(T value_tt, T value) { #if defined(HAVE_TTMATH) return boost::is_same::value ? value_tt : value; #else return value; #endif } template inline T if_typed(T value_typed, T value) { return boost::is_same::value ? value_typed : value; } struct geographic_policy { template static inline CoordinateType apply(CoordinateType const& value) { return value; } }; struct mathematical_policy { template static inline CoordinateType apply(CoordinateType const& value) { return 90 - value; } }; // For all tests: // - do NOT use "using namespace boost::geometry" to make clear what is Boost.Geometry // - use bg:: as short alias #include namespace bg = boost::geometry; #endif // GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP