Upgrade clang-format to version 15 (#6859)

This commit is contained in:
Dennis Luxen
2024-05-06 09:14:46 +02:00
committed by GitHub
parent b503e96a98
commit 7f9d591ab7
156 changed files with 2357 additions and 1894 deletions
@@ -40,17 +40,18 @@ BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
// ↓
// 4
const auto unit_edge =
[](const NodeID from, const NodeID to, bool allowed, AnnotationID annotation) {
return InputEdge{from,
to,
EdgeWeight{1},
EdgeDuration{1},
EdgeDistance{1},
GeometryID{0, false},
!allowed,
NodeBasedEdgeClassification(),
annotation};
};
[](const NodeID from, const NodeID to, bool allowed, AnnotationID annotation)
{
return InputEdge{from,
to,
EdgeWeight{1},
EdgeDuration{1},
EdgeDistance{1},
GeometryID{0, false},
!allowed,
NodeBasedEdgeClassification(),
annotation};
};
std::vector<InputEdge> edges = {unit_edge(0, 2, true, 1),
unit_edge(0, 5, true, 0),
@@ -102,7 +103,8 @@ BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
RestrictionGraph restriction_graph = constructRestrictionGraph(restrictions);
RestrictionMap restriction_map(restriction_graph);
const auto connectivity_matrix = [&](NodeID node) {
const auto connectivity_matrix = [&](NodeID node)
{
std::vector<bool> result;
const auto incoming_edges = getIncomingEdges(graph, node);
const auto outgoing_edges = getOutgoingEdges(graph, node);
@@ -167,7 +169,8 @@ BOOST_AUTO_TEST_CASE(roundabout_intersection_connectivity)
// 0
// ↙ ↑ ↘
// 4 5 6
const auto unit_edge = [](const NodeID from, const NodeID to, bool allowed, bool roundabout) {
const auto unit_edge = [](const NodeID from, const NodeID to, bool allowed, bool roundabout)
{
return InputEdge{from,
to,
EdgeWeight{1},
@@ -226,7 +229,8 @@ BOOST_AUTO_TEST_CASE(roundabout_intersection_connectivity)
RestrictionGraph restriction_graph = constructRestrictionGraph(restrictions);
RestrictionMap restriction_map(restriction_graph);
const auto connectivity_matrix = [&](NodeID node) {
const auto connectivity_matrix = [&](NodeID node)
{
std::vector<bool> result;
const auto incoming_edges = getIncomingEdges(graph, node);
const auto outgoing_edges = getOutgoingEdges(graph, node);
@@ -274,7 +278,8 @@ BOOST_AUTO_TEST_CASE(skip_degree_two_nodes)
// ↑ ↕ ↕
// 6 8 ↔ 9
//
const auto unit_edge = [](const NodeID from, const NodeID to, bool allowed) {
const auto unit_edge = [](const NodeID from, const NodeID to, bool allowed)
{
return InputEdge{from,
to,
EdgeWeight{1},
+15 -16
View File
@@ -56,14 +56,12 @@ void checkInstructions(RestrictionGraph::RestrictionRange restrictions,
});
std::sort(actual_instructions.begin(),
actual_instructions.end(),
[](const auto &lhs, const auto &rhs) {
return (lhs.to < rhs.to) || (lhs.to == rhs.to && lhs.is_only);
});
[](const auto &lhs, const auto &rhs)
{ return (lhs.to < rhs.to) || (lhs.to == rhs.to && lhs.is_only); });
std::sort(expected_instructions.begin(),
expected_instructions.end(),
[](const auto &lhs, const auto &rhs) {
return (lhs.to < rhs.to) || (lhs.to == rhs.to && lhs.is_only);
});
[](const auto &lhs, const auto &rhs)
{ return (lhs.to < rhs.to) || (lhs.to == rhs.to && lhs.is_only); });
BOOST_REQUIRE_EQUAL_COLLECTIONS(actual_instructions.begin(),
actual_instructions.end(),
@@ -88,10 +86,11 @@ void checkEdges(RestrictionGraph::EdgeRange edges, std::vector<NodeID> expected_
std::map<NodeID, size_t> nextEdges(RestrictionGraph::EdgeRange edges)
{
std::map<NodeID, size_t> res;
std::transform(
edges.begin(), edges.end(), std::inserter(res, res.end()), [&](const auto &edge) {
return std::make_pair(edge.node_based_to, edge.target);
});
std::transform(edges.begin(),
edges.end(),
std::inserter(res, res.end()),
[&](const auto &edge)
{ return std::make_pair(edge.node_based_to, edge.target); });
return res;
}
@@ -132,12 +131,12 @@ validateViaRestrictionNode(RestrictionGraph &graph,
BOOST_REQUIRE_GE(graph.via_edge_to_node.count({from, to}), 1);
auto node_match_it = graph.via_edge_to_node.equal_range({from, to});
BOOST_REQUIRE_MESSAGE(
std::any_of(node_match_it.first,
node_match_it.second,
[&](const auto node_match) { return node_match.second == via_node_idx; }),
"Could not find expected via_node_idx " << via_node_idx << " for graph edge " << from << ","
<< to);
BOOST_REQUIRE_MESSAGE(std::any_of(node_match_it.first,
node_match_it.second,
[&](const auto node_match)
{ return node_match.second == via_node_idx; }),
"Could not find expected via_node_idx "
<< via_node_idx << " for graph edge " << from << "," << to);
BOOST_REQUIRE_LT(via_node_idx, graph.num_via_nodes);
return checkNode(