Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63585 - in sandbox/geometry/libs/geometry/test: extensions/gis/latlong strategies
From: barend.gehrels_at_[hidden]
Date: 2010-07-04 06:57:49


Author: barendgehrels
Date: 2010-07-04 06:57:48 EDT (Sun, 04 Jul 2010)
New Revision: 63585
URL: http://svn.boost.org/trac/boost/changeset/63585

Log:
Fixed for gcc
Added:
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/vincenty.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/vincenty.vcproj (contents, props changed)
Text files modified:
   sandbox/geometry/libs/geometry/test/strategies/projected_point.cpp | 9 +++++----
   1 files changed, 5 insertions(+), 4 deletions(-)

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/vincenty.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/vincenty.cpp 2010-07-04 06:57:48 EDT (Sun, 04 Jul 2010)
@@ -0,0 +1,65 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// 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)
+
+
+#include <geometry_test_common.hpp>
+
+#include <boost/concept_check.hpp>
+
+#include <boost/geometry/extensions/gis/geographic/strategies/vincenty.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <test_common/test_point.hpp>
+
+
+template <typename P1, typename P2>
+void test_vincenty(double lon1, double lat1, double lon2, double lat2, double expected_km)
+{
+ typedef boost::geometry::strategy::distance::vincenty<P1, P2> vincenty_type;
+
+ BOOST_CONCEPT_ASSERT( (boost::geometry::concept::PointDistanceStrategy<vincenty_type>) );
+
+ vincenty_type vincenty;
+
+
+ P1 p1, p2;
+
+ boost::geometry::assign(p1, lon1, lat1);
+ boost::geometry::assign(p2, lon2, lat2);
+
+ BOOST_CHECK_CLOSE(double(vincenty.apply(p1, p2)), 1000.0 * expected_km, 0.001);
+}
+
+template <typename P1, typename P2>
+void test_all()
+{
+ test_vincenty<P1, P2>(0, 90, 1, 80, 1116.814237); // polar
+ test_vincenty<P1, P2>(4, 52, 4, 52, 0.0); // no point difference
+ test_vincenty<P1, P2>(4, 52, 3, 40, 1336.039890); // normal case
+}
+
+template <typename P>
+void test_all()
+{
+ test_all<P, P>();
+}
+
+int test_main(int, char* [])
+{
+ using namespace boost::geometry;
+ using namespace boost::geometry::cs;
+
+ //test_all<float[2]>();
+ //test_all<double[2]>();
+ test_all<point<float, 2, geographic<degree> > >();
+ test_all<point<double, 2, geographic<degree> > >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/vincenty.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/vincenty.vcproj 2010-07-04 06:57:48 EDT (Sun, 04 Jul 2010)
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="vincenty"
+ ProjectGUID="{F4A5BE68-7213-498D-944B-023B50FB10FD}"
+ RootNamespace="vincenty"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\vincenty"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\vincenty"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\vincenty.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Modified: sandbox/geometry/libs/geometry/test/strategies/projected_point.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/strategies/projected_point.cpp (original)
+++ sandbox/geometry/libs/geometry/test/strategies/projected_point.cpp 2010-07-04 06:57:48 EDT (Sun, 04 Jul 2010)
@@ -37,8 +37,8 @@
     P p;
     bg::assign(p, 2, 0);
 
- double const sqr_expected = 4;
- double const expected = 2;
+ CalculationType const sqr_expected = 4;
+ CalculationType const expected = 2;
 
 
     namespace bgsd = bg::strategy::distance;
@@ -102,8 +102,9 @@
 
 
     strategy_type strategy;
- typename strategy_type::return_type d = strategy.apply(p, sp1, sp2);
- BOOST_CHECK_CLOSE(d, 0.27735203958327, 0.001);
+ typedef typename strategy_type::return_type return_type;
+ return_type d = strategy.apply(p, sp1, sp2);
+ BOOST_CHECK_CLOSE(d, return_type(0.27735203958327), 0.001);
 }
 
 


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