Upgrade formatting to clang-format 10 (#5895)
* Update formatting tools to clang-format-10 * Reformat using clang-format-10.0.09
This commit is contained in:
@@ -27,8 +27,8 @@ std::ostream &operator<<(std::ostream &out, const QueryEdge &edge)
|
||||
out << "{" << edge.source << ", " << edge.target << ", " << edge.data << "}";
|
||||
return out;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace contractor
|
||||
} // namespace osrm
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(contracted_edge_container)
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ inline contractor::ContractorGraph makeGraph(const std::vector<TestEdge> &edges)
|
||||
|
||||
return contractor::ContractorGraph{max_id + 1, std::move(input_edges)};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace unit_test
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace offline
|
||||
struct Algorithm final
|
||||
{
|
||||
};
|
||||
}
|
||||
} // namespace offline
|
||||
|
||||
} // routing_algorithms
|
||||
} // namespace routing_algorithms
|
||||
|
||||
// Define engine data for offline data facade
|
||||
template <> struct SearchEngineData<routing_algorithms::offline::Algorithm>
|
||||
@@ -386,7 +386,7 @@ class ContiguousInternalMemoryDataFacade<routing_algorithms::offline::Algorithm>
|
||||
}
|
||||
};
|
||||
|
||||
} // datafacade
|
||||
} // namespace datafacade
|
||||
|
||||
// Fallback to MLD algorithm: requires from data facade MLD specific members
|
||||
namespace routing_algorithms
|
||||
@@ -427,11 +427,11 @@ void unpackPath(const FacadeT &facade,
|
||||
mld::unpackPath(facade, packed_path_begin, packed_path_end, phantom_nodes, unpacked_path);
|
||||
}
|
||||
|
||||
} // offline
|
||||
} // routing_algorithms
|
||||
} // namespace offline
|
||||
} // namespace routing_algorithms
|
||||
|
||||
} // engine
|
||||
} // osrm
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(offline_facade)
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
|
||||
1, 0, 0, 1, // from node 1 to nodes 0 and 4
|
||||
1, 1, 0, 1 // from node 3 to nodes 0, 1 and 4
|
||||
// clang-format on
|
||||
);
|
||||
);
|
||||
REQUIRE_SIZE_RANGE(connectivity_matrix(3), 0); // no incoming edges, empty matrix
|
||||
CHECK_EQUAL_RANGE(connectivity_matrix(4), 0); // from node 2 not allowed U-turn
|
||||
CHECK_EQUAL_RANGE(connectivity_matrix(5),
|
||||
@@ -140,14 +140,14 @@ BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
|
||||
0, 1, // from node 0 to node 6
|
||||
0, 1, // from node 6 a U-turn to node 6
|
||||
// clang-format on
|
||||
);
|
||||
);
|
||||
|
||||
CHECK_EQUAL_RANGE(connectivity_matrix(6),
|
||||
// clang-format off
|
||||
1, 0, // from node 5 a U-turn to node 5
|
||||
0, 1, // from node 7 a U-turn to node 7
|
||||
// clang-format on
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(roundabout_intersection_connectivity)
|
||||
@@ -254,7 +254,7 @@ BOOST_AUTO_TEST_CASE(roundabout_intersection_connectivity)
|
||||
0, 1, 0, 1, 0, 0, // from node 3 to nodes 2 and 4
|
||||
0, 1, 0, 1, 0, 1 // from node 5 to nodes 2, 4 and 6
|
||||
// clang-format on
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(skip_degree_two_nodes)
|
||||
|
||||
@@ -18,7 +18,7 @@ osrm::util::Coordinate getZeroCoordinate()
|
||||
{
|
||||
return {osrm::util::FloatLongitude{0}, osrm::util::FloatLatitude{0}};
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(limits)
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ class MockDataFacade final : public MockBaseDataFacade, public MockAlgorithmData
|
||||
{
|
||||
};
|
||||
|
||||
} // ns test
|
||||
} // ns osrm
|
||||
} // namespace test
|
||||
} // namespace osrm
|
||||
|
||||
#endif // MOCK_DATAFACADE_HPP
|
||||
|
||||
@@ -149,7 +149,18 @@ BOOST_AUTO_TEST_CASE(power_of_two_case)
|
||||
0 1 2 3 4 5 6 7 8 9 10 11
|
||||
*/
|
||||
const std::vector<BisectionID> ids_1 = {
|
||||
0b000, 0b000, 0b001, 0b001, 0b010, 0b010, 0b011, 0b011, 0b100, 0b100, 0b101, 0b101,
|
||||
0b000,
|
||||
0b000,
|
||||
0b001,
|
||||
0b001,
|
||||
0b010,
|
||||
0b010,
|
||||
0b011,
|
||||
0b011,
|
||||
0b100,
|
||||
0b100,
|
||||
0b101,
|
||||
0b101,
|
||||
};
|
||||
|
||||
// If cell sizes are not a factor of two we will see sub-optimal results like below
|
||||
@@ -276,7 +287,18 @@ BOOST_AUTO_TEST_CASE(non_factor_two_case)
|
||||
0 1 2 3 4 5 6 7 8 9 10 11
|
||||
*/
|
||||
const std::vector<BisectionID> ids_1 = {
|
||||
0b000, 0b000, 0b001, 0b001, 0b010, 0b010, 0b011, 0b011, 0b100, 0b100, 0b101, 0b101,
|
||||
0b000,
|
||||
0b000,
|
||||
0b001,
|
||||
0b001,
|
||||
0b010,
|
||||
0b010,
|
||||
0b011,
|
||||
0b011,
|
||||
0b100,
|
||||
0b100,
|
||||
0b101,
|
||||
0b101,
|
||||
};
|
||||
|
||||
// If cell sizes are not a factor of two we will see sub-optimal results like below
|
||||
|
||||
@@ -34,7 +34,7 @@ auto makeGraph(const std::vector<MockEdge> &mock_edges)
|
||||
std::sort(edges.begin(), edges.end());
|
||||
return util::StaticGraph<EdgeData>(max_id + 1, edges);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(cell_storage_tests)
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ auto makeGraph(const MultiLevelPartition &mlp, const std::vector<MockEdge> &mock
|
||||
std::sort(edges.begin(), edges.end());
|
||||
return MultiLevelGraph<EdgeData, osrm::storage::Ownership::Container>(mlp, max_id + 1, edges);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(multi_level_graph)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ auto makeGraph(const std::vector<MockEdge> &mock_edges)
|
||||
std::sort(edges.begin(), edges.end());
|
||||
return util::StaticGraph<EdgeData>(max_id + 1, edges);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(remove_unconnected_tests)
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ auto makeGraph(const std::vector<MockEdge> &mock_edges)
|
||||
std::sort(edges.begin(), edges.end());
|
||||
return DynamicEdgeBasedGraph(max_id + 1, edges);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(renumber_tests)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ inline std::ostream &operator<<(std::ostream &out, api::RouteParameters::Overvie
|
||||
}
|
||||
return out;
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &out, Bearing bearing)
|
||||
{
|
||||
@@ -60,7 +60,7 @@ inline std::ostream &operator<<(std::ostream &out, Approach approach)
|
||||
out << static_cast<int>(approach);
|
||||
return out;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
|
||||
@@ -222,7 +222,9 @@ BOOST_AUTO_TEST_CASE(valid_route_urls)
|
||||
CHECK_EQUAL_RANGE(reference_4.hints, result_4->hints);
|
||||
|
||||
std::vector<boost::optional<engine::Bearing>> bearings_4 = {
|
||||
boost::none, engine::Bearing{200, 10}, engine::Bearing{100, 5},
|
||||
boost::none,
|
||||
engine::Bearing{200, 10},
|
||||
engine::Bearing{100, 5},
|
||||
};
|
||||
RouteParameters reference_5{false,
|
||||
false,
|
||||
@@ -323,9 +325,9 @@ BOOST_AUTO_TEST_CASE(valid_route_urls)
|
||||
hints_10,
|
||||
std::vector<boost::optional<double>>{},
|
||||
std::vector<boost::optional<engine::Bearing>>{}};
|
||||
auto result_10 = parseParameters<RouteParameters>("1,2;3,4;5,6;7,8?steps=false&hints=" +
|
||||
hints_10[0]->ToBase64() + ";;" +
|
||||
hints_10[2]->ToBase64() + ";");
|
||||
auto result_10 = parseParameters<RouteParameters>(
|
||||
"1,2;3,4;5,6;7,8?steps=false&hints=" + hints_10[0]->ToBase64() + ";;" +
|
||||
hints_10[2]->ToBase64() + ";");
|
||||
BOOST_CHECK(result_10);
|
||||
BOOST_CHECK_EQUAL(reference_10.steps, result_10->steps);
|
||||
BOOST_CHECK_EQUAL(reference_10.alternatives, result_10->alternatives);
|
||||
@@ -420,7 +422,10 @@ BOOST_AUTO_TEST_CASE(valid_route_urls)
|
||||
BOOST_CHECK_EQUAL(result_17->annotations, true);
|
||||
|
||||
std::vector<boost::optional<engine::Approach>> approaches_18 = {
|
||||
boost::none, engine::Approach::CURB, engine::Approach::UNRESTRICTED, engine::Approach::CURB,
|
||||
boost::none,
|
||||
engine::Approach::CURB,
|
||||
engine::Approach::UNRESTRICTED,
|
||||
engine::Approach::CURB,
|
||||
};
|
||||
RouteParameters reference_18{false,
|
||||
false,
|
||||
|
||||
@@ -15,9 +15,9 @@ std::ostream &operator<<(std::ostream &out, const osrm::server::api::ParsedURL &
|
||||
|
||||
return out;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace api
|
||||
} // namespace server
|
||||
} // namespace osrm
|
||||
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
@@ -150,7 +150,11 @@ BOOST_AUTO_TEST_CASE(tar_serialize_deallocting_vector)
|
||||
BOOST_AUTO_TEST_CASE(buffer_serialize_map)
|
||||
{
|
||||
std::map<std::string, std::int32_t> map = {
|
||||
{"foo", 1}, {"barrrr", 2}, {"bal", 3}, {"bazbar", 4}, {"foofofofo", 5},
|
||||
{"foo", 1},
|
||||
{"barrrr", 2},
|
||||
{"bal", 3},
|
||||
{"bazbar", 4},
|
||||
{"foofofofo", 5},
|
||||
};
|
||||
|
||||
std::string buffer;
|
||||
|
||||
@@ -34,7 +34,7 @@ struct SubRangeCounter
|
||||
template <typename Range> void operator()(Range &&) { count += 1; }
|
||||
std::size_t count = 0;
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
|
||||
BOOST_AUTO_TEST_CASE(grouped_empty_test)
|
||||
{
|
||||
|
||||
@@ -88,7 +88,9 @@ BOOST_AUTO_TEST_CASE(tar_serialize_variable_indexed_data)
|
||||
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17},
|
||||
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}};
|
||||
std::vector<std::string> char_data = {
|
||||
"HalloFoo", "ABCDEFGHIJKLMNOPQR", "ABCDEFGHIJKLMNOP",
|
||||
"HalloFoo",
|
||||
"ABCDEFGHIJKLMNOPQR",
|
||||
"ABCDEFGHIJKLMNOP",
|
||||
};
|
||||
|
||||
for (const auto i : util::irange<std::size_t>(0, offset_data.size()))
|
||||
|
||||
Reference in New Issue
Block a user