replace cassert by boost asserts
This commit is contained in:
parent
9812eaaca7
commit
d1e1190cbd
@ -23,8 +23,9 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
#ifndef SHORTESTPATHROUTING_H_
|
#ifndef SHORTESTPATHROUTING_H_
|
||||||
#define SHORTESTPATHROUTING_H_
|
#define SHORTESTPATHROUTING_H_
|
||||||
|
|
||||||
#include "BasicRoutingInterface.h"
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
|
#include "BasicRoutingInterface.h"
|
||||||
#include "../DataStructures/SearchEngineData.h"
|
#include "../DataStructures/SearchEngineData.h"
|
||||||
|
|
||||||
template<class DataFacadeT>
|
template<class DataFacadeT>
|
||||||
@ -206,7 +207,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Was at most one of the two paths not found?
|
//Was at most one of the two paths not found?
|
||||||
assert(INT_MAX != distance1 || INT_MAX != distance2);
|
BOOST_ASSERT_MSG(
|
||||||
|
(INT_MAX != distance1 || INT_MAX != distance2),
|
||||||
|
"no path found"
|
||||||
|
);
|
||||||
|
|
||||||
//Unpack paths if they exist
|
//Unpack paths if they exist
|
||||||
std::vector<NodeID> temporary_packed_path1;
|
std::vector<NodeID> temporary_packed_path1;
|
||||||
@ -247,13 +251,22 @@ public:
|
|||||||
local_upper_bound2 = local_upper_bound1;
|
local_upper_bound2 = local_upper_bound1;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(temporary_packed_path1.empty() && temporary_packed_path2.empty());
|
BOOST_ASSERT_MSG(
|
||||||
|
temporary_packed_path1.empty() &&
|
||||||
|
temporary_packed_path2.empty(),
|
||||||
|
"tempory packed paths not empty"
|
||||||
|
);
|
||||||
|
|
||||||
//Plug paths together, s.t. end of packed path is begin of temporary packed path
|
//Plug paths together, s.t. end of packed path is begin of temporary packed path
|
||||||
if( !packed_path1.empty() && !packed_path2.empty() ) {
|
if( !packed_path1.empty() && !packed_path2.empty() ) {
|
||||||
if( temporary_packed_path1.front() == temporary_packed_path2.front() ) {
|
if( temporary_packed_path1.front() == temporary_packed_path2.front() ) {
|
||||||
//both new route segments start with the same node, thus one of the packedPath must go.
|
//both new route segments start with the same node, thus one of the packedPath must go.
|
||||||
assert( (packed_path1.size() == packed_path2.size() ) || (*(packed_path1.end()-1) != *(packed_path2.end()-1)) );
|
BOOST_ASSERT_MSG(
|
||||||
|
(packed_path1.size() == packed_path2.size() ) ||
|
||||||
|
(packed_path1.back() != packed_path2.back() ),
|
||||||
|
"packed paths must be different"
|
||||||
|
);
|
||||||
|
|
||||||
if( packed_path1.back() == temporary_packed_path1.front()) {
|
if( packed_path1.back() == temporary_packed_path1.front()) {
|
||||||
packed_path2.clear();
|
packed_path2.clear();
|
||||||
packed_path2.insert(
|
packed_path2.insert(
|
||||||
|
Loading…
Reference in New Issue
Block a user