$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r76855 - trunk/libs/geometry/test/io/wkt
From: barend.gehrels_at_[hidden]
Date: 2012-02-03 11:22:46
Author: barendgehrels
Date: 2012-02-03 11:22:43 EST (Fri, 03 Feb 2012)
New Revision: 76855
URL: http://svn.boost.org/trac/boost/changeset/76855
Log:
Updated WKT test w.r.t. ttmath
Text files modified: 
   trunk/libs/geometry/test/io/wkt/wkt.cpp    |    63 ++++++++++++++++++++++----------------- 
   trunk/libs/geometry/test/io/wkt/wkt.vcproj |     4 +-                                      
   2 files changed, 37 insertions(+), 30 deletions(-)
Modified: trunk/libs/geometry/test/io/wkt/wkt.cpp
==============================================================================
--- trunk/libs/geometry/test/io/wkt/wkt.cpp	(original)
+++ trunk/libs/geometry/test/io/wkt/wkt.cpp	2012-02-03 11:22:43 EST (Fri, 03 Feb 2012)
@@ -12,7 +12,6 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-//#include <iostream>
 #include <sstream>
 #include <string>
 
@@ -58,40 +57,27 @@
         BOOST_CHECK_CLOSE(double(bg::perimeter(geometry)), peri, 0.0001);
     }
 
-    // String comparison: only for int/double/float etc
-    // GMP/CLN add +e01, L0, etc
-    if (boost::is_fundamental
-        <
-            typename bg::coordinate_type<G>::type
-        >::type::value)
-    {
-        std::ostringstream out;
-        out << bg::wkt(geometry);
-        BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()),
-                    boost::to_upper_copy(wkt));
-    }
+    std::ostringstream out;
+    out << bg::wkt(geometry);
+    BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()),
+                boost::to_upper_copy(wkt));
 }
 
 template <typename G>
 void test_relaxed_wkt(std::string const& wkt, std::string const& expected)
 {
-    if (boost::is_fundamental
-        <
-            typename bg::coordinate_type<G>::type
-        >::type::value)
-    {
-        std::string e;
-        G geometry;
-        bg::read_wkt(wkt, geometry);
-        std::ostringstream out;
-        out << bg::wkt(geometry);
+    std::string e;
+    G geometry;
+    bg::read_wkt(wkt, geometry);
+    std::ostringstream out;
+    out << bg::wkt(geometry);
 
-        BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()), boost::to_upper_copy(expected));
-    }
+    BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()), boost::to_upper_copy(expected));
 }
 
 
 
+
 template <typename G>
 void test_wrong_wkt(std::string const& wkt, std::string const& start)
 {
@@ -106,8 +92,29 @@
         e = ex.what();
         boost::to_lower(e);
     }
-    BOOST_CHECK_MESSAGE(boost::starts_with(e, start), "  Expected:"
-                << start << " Got:" << e << " with WKT: " << wkt);
+    catch(...)
+    {
+        e = "other exception";
+    }
+
+    bool check = true;
+
+#if defined(HAVE_TTMATH)
+    // For ttmath we skip bad lexical casts
+    typedef typename bg::coordinate_type<G>::type ct;
+
+    if (boost::is_same<ct, ttmath_big>::type::value
+        && boost::starts_with(start, "bad lexical cast"))
+    {
+        check = false;
+    }
+#endif
+
+    if (check)
+    {
+        BOOST_CHECK_MESSAGE(boost::starts_with(e, start), "  Expected:"
+                    << start << " Got:" << e << " with WKT: " << wkt);
+    }
 }
 
 template <typename G>
@@ -126,7 +133,7 @@
     using namespace boost::geometry;
     typedef bg::model::point<T, 2, bg::cs::cartesian> P;
 
-    test_wkt<P >("POINT(1 2)", 1);
+    test_wkt<P>("POINT(1 2)", 1);
     test_wkt<bg::model::linestring<P> >("LINESTRING(1 1,2 2,3 3)", 3, 2 * sqrt(2.0));
     test_wkt<bg::model::polygon<P> >("POLYGON((0 0,0 4,4 4,4 0,0 0)"
             ",(1 1,1 2,2 2,2 1,1 1),(1 1,1 2,2 2,2 1,1 1))", 15, 0, 18, 24);
Modified: trunk/libs/geometry/test/io/wkt/wkt.vcproj
==============================================================================
--- trunk/libs/geometry/test/io/wkt/wkt.vcproj	(original)
+++ trunk/libs/geometry/test/io/wkt/wkt.vcproj	2012-02-03 11:22:43 EST (Fri, 03 Feb 2012)
@@ -20,7 +20,7 @@
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
                         IntermediateDirectory="$(ConfigurationName)\wkt"
                         ConfigurationType="1"
-			InheritedPropertySheets="..\..\boost.vsprops"
+			InheritedPropertySheets="..\..\boost.vsprops;..\..\ttmath.vsprops"
                         CharacterSet="1"
 			>
                         <Tool
@@ -93,7 +93,7 @@
                         OutputDirectory="$(SolutionDir)$(ConfigurationName)"
                         IntermediateDirectory="$(ConfigurationName)\wkt"
                         ConfigurationType="1"
-			InheritedPropertySheets="..\..\boost.vsprops"
+			InheritedPropertySheets="..\..\boost.vsprops;..\..\ttmath.vsprops"
                         CharacterSet="1"
                         WholeProgramOptimization="1"
 			>