From c85f6c122840aa55261976c727c652dd137151f1 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 20 Sep 2013 11:35:59 +0200 Subject: [PATCH] replacing cassert by boost asserts --- RoutingAlgorithms/BasicRoutingInterface.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RoutingAlgorithms/BasicRoutingInterface.h b/RoutingAlgorithms/BasicRoutingInterface.h index dc132223d..df1268218 100644 --- a/RoutingAlgorithms/BasicRoutingInterface.h +++ b/RoutingAlgorithms/BasicRoutingInterface.h @@ -28,9 +28,9 @@ or see http://www.gnu.org/licenses/agpl.txt. #include "../Util/ContainerUtils.h" #include "../Util/SimpleLogger.h" +#include #include -#include #include #include @@ -82,7 +82,7 @@ public: const NodeID to = facade->GetTarget(edge); const int edgeWeight = data.distance; - assert( edgeWeight > 0 ); + BOOST_ASSERT_MSG( edgeWeight > 0, "edgeWeight invalid" ); if(_forwardHeap.WasInserted( to )) { if(_forwardHeap.GetKey( to ) + edgeWeight < distance) { @@ -100,7 +100,7 @@ public: const NodeID to = facade->GetTarget(edge); const int edgeWeight = data.distance; - assert( edgeWeight > 0 ); + BOOST_ASSERT_MSG( edgeWeight > 0, "edgeWeight invalid" ); const int toDistance = distance + edgeWeight; //New Node discovered -> Add to Heap + Node Info Storage @@ -150,7 +150,7 @@ public: } } } - assert(smallestWeight != INT_MAX); + BOOST_ASSERT_MSG(smallestWeight != INT_MAX, "edge id invalid"); const typename DataFacadeT::EdgeData& ed = facade->GetEdgeData(smallestEdge); if(ed.shortcut) {//unpack @@ -159,7 +159,7 @@ public: recursionStack.push(std::make_pair(middle, edge.second)); recursionStack.push(std::make_pair(edge.first, middle)); } else { - assert(!ed.shortcut); + BOOST_ASSERT_MSG(!ed.shortcut, "edge must be a shortcut"); unpackedPath.push_back( _PathData( ed.id, @@ -200,7 +200,7 @@ public: } } } - assert(smallestWeight != INT_MAX); + BOOST_ASSERT_MSG(smallestWeight != INT_MAX, "edge weight invalid"); const typename DataFacadeT::EdgeData& ed = facade->GetEdgeData(smallestEdge); if(ed.shortcut) {//unpack @@ -209,7 +209,7 @@ public: recursionStack.push(std::make_pair(middle, edge.second)); recursionStack.push(std::make_pair(edge.first, middle)); } else { - assert(!ed.shortcut); + BOOST_ASSERT_MSG(!ed.shortcut, "edge must be shortcut"); unpackedPath.push_back(edge.first ); } }