Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64506 - sandbox/geometry/libs/geometry/test/ranges
From: barend.gehrels_at_[hidden]
Date: 2010-07-31 14:48:59


Author: barendgehrels
Date: 2010-07-31 14:48:58 EDT (Sat, 31 Jul 2010)
New Revision: 64506
URL: http://svn.boost.org/trac/boost/changeset/64506

Log:
added box_range test
Added:
   sandbox/geometry/libs/geometry/test/ranges/box_range.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/ranges/box_range.vcproj (contents, props changed)

Added: sandbox/geometry/libs/geometry/test/ranges/box_range.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/ranges/box_range.cpp 2010-07-31 14:48:58 EDT (Sat, 31 Jul 2010)
@@ -0,0 +1,64 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 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)
+
+#include <algorithm>
+#include <iterator>
+#include <sstream>
+#include <string>
+
+#include <geometry_test_common.hpp>
+
+#include <boost/geometry/geometries/cartesian2d.hpp>
+#include <boost/geometry/ranges/box_range.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+
+template <typename Box>
+void test_geometry(std::string const& wkt, std::string const& expected)
+{
+ namespace bg = boost::geometry;
+
+ Box box;
+ bg::read_wkt(wkt, box);
+
+ typedef bg::box_range<Box> range_type;
+ range_type range(box);
+
+ {
+ std::ostringstream out;
+ for (typename boost::range_iterator<range_type>::type it = boost::begin(range);
+ it != boost::end(range); ++it)
+ {
+ out << " " << boost::geometry::get<0>(*it) << boost::geometry::get<1>(*it);
+ }
+ BOOST_CHECK_EQUAL(out.str(), expected);
+ }
+
+ {
+ // Check forward/backward behaviour
+ typename boost::range_iterator<range_type>::type it = boost::begin(range);
+ it++;
+ it--;
+ // Not verified further, same as segment
+ }
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::box<P> >("polygon((1 1,2 2))", " 11 12 22 21 11");
+ test_geometry<boost::geometry::box<P> >("polygon((3 3,5 5))", " 33 35 55 53 33");
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_2d>();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/ranges/box_range.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/ranges/box_range.vcproj 2010-07-31 14:48:58 EDT (Sat, 31 Jul 2010)
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="box_range"
+ ProjectGUID="{34A1F53A-DA46-41E6-9E26-740D22D662DC}"
+ RootNamespace="box_range"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\box_range"
+ 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"
+ WarningLevel="3"
+ 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"
+ EmbedManifest="false"
+ />
+ <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)\box_range"
+ 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"
+ WarningLevel="3"
+ />
+ <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"
+ EmbedManifest="false"
+ />
+ <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=".\box_range.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>


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