[extensions] Replace BOOST_ASSERT with BOOST_GEOMETRY_ASSERT.

This commit is contained in:
Adam Wulkiewicz
2015-06-08 13:38:59 +02:00
parent 55b474019e
commit a5f3400a2a
7 changed files with 20 additions and 16 deletions

View File

@@ -15,7 +15,6 @@
#include <iterator>
#include <limits>
#include <boost/assert.hpp>
#include <boost/concept_check.hpp>
#include <boost/cstdint.hpp>
#include <boost/type_traits/is_integral.hpp>
@@ -23,6 +22,7 @@
#include <boost/static_assert.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
@@ -193,7 +193,7 @@ struct point_container_parser
}
typedef typename std::iterator_traits<Iterator>::difference_type size_type;
BOOST_ASSERT(num_points <= boost::uint32_t( (std::numeric_limits<size_type>::max)() ) );
BOOST_GEOMETRY_ASSERT(num_points <= boost::uint32_t( (std::numeric_limits<size_type>::max)() ) );
size_type const container_size = static_cast<size_type>(num_points);
size_type const point_size = dimension<point_type>::value * sizeof(double);
@@ -237,7 +237,7 @@ struct linestring_parser
return false;
}
BOOST_ASSERT(it != end);
BOOST_GEOMETRY_ASSERT(it != end);
return point_container_parser<L>::parse(it, end, linestring, order);
}
};

View File

@@ -15,6 +15,10 @@
#include <string>
#include <boost/cstdint.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/geometry/core/assert.hpp>
namespace boost { namespace geometry
{
@@ -85,7 +89,7 @@ bool wkb2hex(Iterator begin, Iterator end, std::string& hex)
// because begin/end always are random access iterators.
typename std::iterator_traits<Iterator>::difference_type
diff = std::distance(begin, end);
BOOST_ASSERT(diff > 0);
BOOST_GEOMETRY_ASSERT(diff > 0);
return hex.size() == 2 * std::string::size_type(diff);
}

View File

@@ -38,7 +38,7 @@
#include <cassert>
#include <cmath>
#include <boost/assert.hpp>
#include <boost/geometry/core/assert.hpp>
namespace boost { namespace geometry { namespace projections {
@@ -55,7 +55,7 @@ static const int APA_SIZE = 3;
/* determine latitude from authalic latitude */
inline bool pj_authset(double es, double* APA)
{
BOOST_ASSERT(0 != APA);
BOOST_GEOMETRY_ASSERT(0 != APA);
double t = 0;
@@ -75,7 +75,7 @@ inline bool pj_authset(double es, double* APA)
inline double pj_authlat(double beta, const double* APA)
{
BOOST_ASSERT(0 != APA);
BOOST_GEOMETRY_ASSERT(0 != APA);
double const t = beta + beta;

View File

@@ -435,7 +435,7 @@ private:
if (n->is_leaf())
{
// TODO: mloskot - add assert(node.size() >= 2); or similar
// TODO: mloskot - add BOOST_GEOMETRY_ASSERT(node.size() >= 2); or similar
typename rtree_leaf<Box, Value>::leaf_map nodes = n->get_leaves();
unsigned int remaining = nodes.size() - 2;
@@ -510,7 +510,7 @@ private:
}
else
{
// TODO: mloskot - add assert(node.size() >= 2); or similar
// TODO: mloskot - add BOOST_GEOMETRY_ASSERT(node.size() >= 2); or similar
typename rtree_node<Box, Value>::node_map nodes = n->get_nodes();
unsigned int remaining = nodes.size() - 2;

View File

@@ -18,11 +18,12 @@
#include <iterator>
#include <boost/assert.hpp>
#include <boost/iterator.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/iterator_categories.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/algorithms/equals.hpp>
// Helper geometry
@@ -60,14 +61,14 @@ struct segment_returning_iterator
{
if (m_it != m_end)
{
BOOST_ASSERT(m_prev != m_end);
BOOST_GEOMETRY_ASSERT(m_prev != m_end);
++m_it;
}
}
reference operator*()
{
BOOST_ASSERT(m_it != m_end && m_prev != m_end);
BOOST_GEOMETRY_ASSERT(m_it != m_end && m_prev != m_end);
p1 = *m_prev;
p2 = *m_it;

View File

@@ -91,7 +91,7 @@ struct find_greatest_normalized_separation<Elements, Parameters, Translator, nsp
// highest_low - lowest_high
separation = difference<separation_type>(lowest_high, highest_low);
// BOOST_ASSERT(0 <= width);
// BOOST_GEOMETRY_INDEX_ASSERT(0 <= width);
if ( std::numeric_limits<coordinate_type>::epsilon() < width )
separation /= width;

View File

@@ -15,9 +15,8 @@
#ifndef BOOST_GEOMETRY_EXTENSIONS_NSPHERE_STRATEGIES_CARTESIAN_POINT_IN_NSPHERE_HPP
#define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_STRATEGIES_CARTESIAN_POINT_IN_NSPHERE_HPP
#include <cassert>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/assert.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/strategies/covered_by.hpp>
#include <boost/geometry/strategies/within.hpp>
@@ -75,7 +74,7 @@ struct point_in_nsphere
// static bool apply(A const& a, B const& b)
// {
// // Assertion if called
// assert(false);
// BOOST_GEOMETRY_ASSERT(false);
// return false;
// }
//};