Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64508 - sandbox/geometry/libs/geometry/test/iterators
From: barend.gehrels_at_[hidden]
Date: 2010-07-31 14:52:45


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

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

Added: sandbox/geometry/libs/geometry/test/iterators/box_iterator.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/box_iterator.cpp 2010-07-31 14:52:44 EDT (Sat, 31 Jul 2010)
@@ -0,0 +1,54 @@
+// Boost.Geometry (aka GGL, Generic Box Library)
+//
+// 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 <sstream>
+#include <string>
+#include <vector>
+
+#include <geometry_test_common.hpp>
+
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+#include <boost/geometry/iterators/box_iterator.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+#include <test_geometries/custom_segment.hpp>
+
+
+template <typename Box>
+void test_geometry(std::string const& wkt, std::string const& expected)
+{
+ Box box;
+ boost::geometry::read_wkt(wkt, box);
+
+ {
+ std::ostringstream out;
+ boost::geometry::box_iterator<Box> it(box), end(box, true);
+ for ( ; it != end; ++it)
+ {
+ out << " " << boost::geometry::get<0>(*it) << boost::geometry::get<1>(*it);
+ }
+ BOOST_CHECK_EQUAL(out.str(), expected);
+ }
+}
+
+
+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/iterators/box_iterator.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/box_iterator.vcproj 2010-07-31 14:52:44 EDT (Sat, 31 Jul 2010)
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="box_iterator"
+ ProjectGUID="{CD4B14B2-ED74-4111-B8BF-093FA3930A5C}"
+ RootNamespace="box_iterator"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\box_iterator"
+ 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"
+ 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_iterator"
+ 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"
+ 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_iterator.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