Fix osrm-contract, tests, on Windows
As part of graph contraction, node renumbering leads to in-place permuting of graph state, including boolean vector elements. std::vector<bool> returns proxy objects when referencing individual bits. To correctly swap bool elements using MSVC, we need to explicitly apply std::vector<bool>::swap. Making this change fixes osrm-contract on Windows. We also correct failing tests and other undefined behaviours (mainly iterator access outside boundaries) highlighted by MSVC.
This commit is contained in:
@@ -11,9 +11,11 @@
|
||||
const auto &rhs = {__VA_ARGS__}; \
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); \
|
||||
} while (0)
|
||||
#define CHECK_EQUAL_COLLECTIONS(lhs, rhs) \
|
||||
#define CHECK_EQUAL_COLLECTIONS(coll_lhs, coll_rhs) \
|
||||
do \
|
||||
{ \
|
||||
const auto &lhs = coll_lhs; \
|
||||
const auto &rhs = coll_rhs; \
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); \
|
||||
} while (0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user