Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83641 - in trunk/libs/geometry/test: . index index/algorithms
From: adam.wulkiewicz_at_[hidden]
Date: 2013-03-29 22:02:48


Author: awulkiew
Date: 2013-03-29 22:02:47 EDT (Fri, 29 Mar 2013)
New Revision: 83641
URL: http://svn.boost.org/trac/boost/changeset/83641

Log:
Geometry.Index test integrated. Error in margin test fixed.
Removed:
   trunk/libs/geometry/test/index/geometry_test_common.hpp
Text files modified:
   trunk/libs/geometry/test/Jamfile.v2 | 1 +
   trunk/libs/geometry/test/index/Jamfile.v2 | 2 --
   trunk/libs/geometry/test/index/algorithms/margin.cpp | 16 ++++++++--------
   trunk/libs/geometry/test/index/algorithms/test_margin.hpp | 2 +-
   4 files changed, 10 insertions(+), 11 deletions(-)

Modified: trunk/libs/geometry/test/Jamfile.v2
==============================================================================
--- trunk/libs/geometry/test/Jamfile.v2 (original)
+++ trunk/libs/geometry/test/Jamfile.v2 2013-03-29 22:02:47 EDT (Fri, 29 Mar 2013)
@@ -26,6 +26,7 @@
 build-project iterators ;
 build-project strategies ;
 build-project policies ;
+build-project index ;
 build-project io ;
 build-project util ;
 build-project views ;

Modified: trunk/libs/geometry/test/index/Jamfile.v2
==============================================================================
--- trunk/libs/geometry/test/index/Jamfile.v2 (original)
+++ trunk/libs/geometry/test/index/Jamfile.v2 2013-03-29 22:02:47 EDT (Fri, 29 Mar 2013)
@@ -13,8 +13,6 @@
     requirements
         <include>.
         <include>..
- <include>../..
- <include>../../..
         #<include>../../../boost/geometry/extensions/contrib/ttmath
         <toolset>msvc:<asynch-exceptions>on
     ;

Modified: trunk/libs/geometry/test/index/algorithms/margin.cpp
==============================================================================
--- trunk/libs/geometry/test/index/algorithms/margin.cpp (original)
+++ trunk/libs/geometry/test/index/algorithms/margin.cpp 2013-03-29 22:02:47 EDT (Fri, 29 Mar 2013)
@@ -27,8 +27,8 @@
     bg::read_wkt(box_li, int_box);
     bg::read_wkt(box_li, double_box);
 
- double int_value = bgi::detail::margin(int_box);
- double double_value = bgi::detail::margin(double_box);
+ double int_value = bgi::detail::comparable_margin(int_box);
+ double double_value = bgi::detail::comparable_margin(double_box);
 
     BOOST_CHECK_CLOSE(int_value, double_value, 0.0001);
 }
@@ -43,12 +43,12 @@
     typedef bg::model::point<float, 3, bg::cs::cartesian> P3fc;
     typedef bg::model::point<double, 3, bg::cs::cartesian> P3dc;
     
- test_geometry<bg::model::box<P2ic> >("POLYGON((0 1,2 4))", 10.0);
- test_geometry<bg::model::box<P2fc> >("POLYGON((0 1,2 4))", 10.0);
- test_geometry<bg::model::box<P2dc> >("POLYGON((0 1,2 4))", 10.0);
- test_geometry<bg::model::box<P3ic> >("POLYGON((0 1 2,2 4 6))", 52);
- test_geometry<bg::model::box<P3fc> >("POLYGON((0 1 2,2 4 6))", 52.0);
- test_geometry<bg::model::box<P3dc> >("POLYGON((0 1 2,2 4 6))", 52.0);
+ test_geometry<bg::model::box<P2ic> >("POLYGON((0 1,2 4))", 5);
+ test_geometry<bg::model::box<P2fc> >("POLYGON((0 1,2 4))", 5.0);
+ test_geometry<bg::model::box<P2dc> >("POLYGON((0 1,2 4))", 5.0);
+ test_geometry<bg::model::box<P3ic> >("POLYGON((0 1 2,2 4 6))", 9);
+ test_geometry<bg::model::box<P3fc> >("POLYGON((0 1 2,2 4 6))", 9.0);
+ test_geometry<bg::model::box<P3dc> >("POLYGON((0 1 2,2 4 6))", 9.0);
     
 #ifdef HAVE_TTMATH
     typedef bg::model::point<ttmath_big, 2, bg::cs::cartesian> P2ttmc;

Modified: trunk/libs/geometry/test/index/algorithms/test_margin.hpp
==============================================================================
--- trunk/libs/geometry/test/index/algorithms/test_margin.hpp (original)
+++ trunk/libs/geometry/test/index/algorithms/test_margin.hpp 2013-03-29 22:02:47 EDT (Fri, 29 Mar 2013)
@@ -20,7 +20,7 @@
 void test_margin(Geometry const& geometry,
             typename bgi::detail::default_margin_result<Geometry>::type expected_value)
 {
- typename bgi::detail::default_margin_result<Geometry>::type value = bgi::detail::margin(geometry);
+ typename bgi::detail::default_margin_result<Geometry>::type value = bgi::detail::comparable_margin(geometry);
 
 #ifdef GEOMETRY_TEST_DEBUG
     std::ostringstream out;

Deleted: trunk/libs/geometry/test/index/geometry_test_common.hpp
==============================================================================
--- trunk/libs/geometry/test/index/geometry_test_common.hpp 2013-03-29 22:02:47 EDT (Fri, 29 Mar 2013)
+++ (empty file)
@@ -1,162 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-
-// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
-// Copyright (c) 2009-2012 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 <boost/config.hpp>
-
-
-#if defined(BOOST_INTEL_CXX_VERSION)
-#define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE
-#endif
-
-
-#include <boost/foreach.hpp>
-
-
-// Include some always-included-for-testing files
-#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
-
-// Until Boost fixes it, silence warning issued by clang:
-// warning: unused variable 'check_is_close' [-Wunused-variable]
-#ifdef __clang__
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wunused-variable"
-#endif
-
-# include <boost/test/floating_point_comparison.hpp>
-# include <boost/test/included/test_exec_monitor.hpp>
-//# include <boost/test/included/prg_exec_monitor.hpp>
-# include <boost/test/impl/execution_monitor.ipp>
-
-#ifdef __clang__
-# pragma clang diagnostic pop
-#endif
-
-#endif
-
-
-#if defined(HAVE_TTMATH)
-# include <boost/geometry/extensions/contrib/ttmath_stub.hpp>
-#endif
-
-#if defined(HAVE_CLN) || defined(HAVE_GMP)
-# include <boost/numeric_adaptor/numeric_adaptor.hpp>
-#endif
-
-
-#if defined(HAVE_GMP)
-# include <boost/numeric_adaptor/gmp_value_type.hpp>
-#endif
-#if defined(HAVE_CLN)
-# include <boost/numeric_adaptor/cln_value_type.hpp>
-#endif
-
-
-template <typename T>
-struct string_from_type {};
-
-template <> struct string_from_type<void>
-{ static std::string name() { return "v"; } };
-
-template <> struct string_from_type<float>
-{ static std::string name() { return "f"; } };
-
-template <> struct string_from_type<double>
-{ static std::string name() { return "d"; } };
-
-template <> struct string_from_type<long double>
-{ static std::string name() { return "e"; } };
-
-#if defined(HAVE_TTMATH)
- template <> struct string_from_type<ttmath_big>
- { static std::string name() { return "t"; } };
-#endif
-
-#if defined(BOOST_RATIONAL_HPP)
-template <typename T> struct string_from_type<boost::rational<T> >
-{ static std::string name() { return "r"; } };
-#endif
-
-
-#if defined(HAVE_GMP)
- template <> struct string_from_type<boost::numeric_adaptor::gmp_value_type>
- { static std::string name() { return "g"; } };
-#endif
-
-#if defined(HAVE_CLN)
- template <> struct string_from_type<boost::numeric_adaptor::cln_value_type>
- { static std::string name() { return "c"; } };
-#endif
-
-
-template <typename CoordinateType, typename T1, typename T2>
-inline T1 if_typed_tt(T1 value_tt, T2 value)
-{
-#if defined(HAVE_TTMATH)
- return boost::is_same<CoordinateType, ttmath_big>::type::value ? value_tt : value;
-#else
- return value;
-#endif
-}
-
-template <typename CoordinateType, typename Specified, typename T>
-inline T if_typed(T value_typed, T value)
-{
- return boost::is_same<CoordinateType, Specified>::value ? value_typed : value;
-}
-
-
-
-
-struct geographic_policy
-{
- template <typename CoordinateType>
- static inline CoordinateType apply(CoordinateType const& value)
- {
- return value;
- }
-};
-
-struct mathematical_policy
-{
- template <typename CoordinateType>
- 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 <boost/geometry/core/tag.hpp>
-namespace bg = boost::geometry;
-
-
-#endif // GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk