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
+2 -1
View File
@@ -28,7 +28,8 @@ BOOST_AUTO_TEST_CASE(access_nodes)
const auto to_row = [cols](const NodeID nid) { return nid / cols; };
const auto to_col = [cols](const NodeID nid) { return nid % cols; };
const auto get_expected = [&](const NodeID id) {
const auto get_expected = [&](const NodeID id)
{
const auto expected_lon = FloatLongitude{to_col(id) * step_size};
const auto expected_lat = FloatLatitude{to_row(id) * step_size};
Coordinate compare(expected_lon, expected_lat);
+2 -1
View File
@@ -40,7 +40,8 @@ BOOST_AUTO_TEST_SUITE(cell_storage_tests)
BOOST_AUTO_TEST_CASE(mutable_cell_storage)
{
const auto fill_range = [](auto range, const std::vector<EdgeWeight> &values) {
const auto fill_range = [](auto range, const std::vector<EdgeWeight> &values)
{
auto iter = range.begin();
for (auto v : values)
*iter++ = v;
+4 -2
View File
@@ -21,11 +21,13 @@ BOOST_AUTO_TEST_CASE(horizontal_cut_between_two_grids)
const int cols = 10;
// build a small grid (10*10) and a (100 * 10) below (to make the different steps unique)
auto graph = [&]() {
auto graph = [&]()
{
std::vector<Coordinate> grid_coordinates;
std::vector<EdgeWithSomeAdditionalData> grid_edges;
const auto connect = [&grid_edges](const NodeID from, const NodeID to) {
const auto connect = [&grid_edges](const NodeID from, const NodeID to)
{
grid_edges.push_back({from, to, 1});
grid_edges.push_back({to, from, 1});
};
@@ -192,9 +192,10 @@ BOOST_AUTO_TEST_CASE(large_cell_number)
for (auto l : util::irange<size_t>(1UL, num_levels))
{
std::transform(levels[l - 1].begin(), levels[l - 1].end(), levels[l].begin(), [](auto val) {
return val / 2;
});
std::transform(levels[l - 1].begin(),
levels[l - 1].end(),
levels[l].begin(),
[](auto val) { return val / 2; });
levels_to_num_cells[l] = levels_to_num_cells[l - 1] / 2;
}
@@ -244,7 +245,8 @@ BOOST_AUTO_TEST_CASE(cell_64_bits)
std::vector<CellID>(level_cells[0]));
std::vector<uint32_t> levels_to_num_cells(level_cells.size());
const auto set_level_cells = [&](size_t level, auto const num_cells) {
const auto set_level_cells = [&](size_t level, auto const num_cells)
{
for (auto val : util::irange<size_t>(0ULL, NUM_PARTITIONS))
{
levels[level][val] = std::min(val, num_cells - 1);
@@ -273,7 +275,8 @@ BOOST_AUTO_TEST_CASE(cell_overflow_bits)
std::vector<CellID>(level_cells[0]));
std::vector<uint32_t> levels_to_num_cells(level_cells.size());
const auto set_level_cells = [&](size_t level, auto const num_cells) {
const auto set_level_cells = [&](size_t level, auto const num_cells)
{
for (auto val : util::irange<size_t>(0ULL, NUM_PARTITIONS))
{
levels[level][val] = std::min(val, num_cells - 1);
@@ -20,18 +20,19 @@ BOOST_AUTO_TEST_CASE(dividing_four_grid_cells)
const int cols = 10;
const int cut_edges = 4;
auto graph = [&]() {
auto graph = [&]()
{
std::vector<Coordinate> grid_coordinates;
std::vector<EdgeWithSomeAdditionalData> grid_edges;
const auto connect =
[&grid_edges](int min_left, int max_left, int min_right, int max_right) {
const NodeID source = (rand() % (max_left - min_left)) + min_left;
const NodeID target = (rand() % (max_right - min_right)) + min_right;
const auto connect = [&grid_edges](int min_left, int max_left, int min_right, int max_right)
{
const NodeID source = (rand() % (max_left - min_left)) + min_left;
const NodeID target = (rand() % (max_right - min_right)) + min_right;
grid_edges.push_back({source, target, 1});
grid_edges.push_back({target, source, 1});
};
grid_edges.push_back({source, target, 1});
grid_edges.push_back({target, source, 1});
};
// generate 10 big components
for (int i = 0; i < 4; ++i)
+8 -7
View File
@@ -21,7 +21,8 @@ BOOST_AUTO_TEST_CASE(graph_views_on_components)
const int num_components = 10;
auto graph = [&]() {
auto graph = [&]()
{
std::vector<Coordinate> grid_coordinates;
std::vector<EdgeWithSomeAdditionalData> grid_edges;
@@ -56,14 +57,14 @@ BOOST_AUTO_TEST_CASE(graph_views_on_components)
const auto &view = views[comp];
BOOST_CHECK(views[comp].NumberOfNodes() == 10);
const auto to_component_id = [&](const auto &node) {
return node.original_id / (rows * cols + 1);
};
const auto to_component_id = [&](const auto &node)
{ return node.original_id / (rows * cols + 1); };
std::size_t expected_component_id = to_component_id(view.Node(0));
BOOST_CHECK(std::all_of(view.Begin(), view.End(), [&](const auto &node) {
return to_component_id(node) == expected_component_id;
}));
BOOST_CHECK(std::all_of(view.Begin(),
view.End(),
[&](const auto &node)
{ return to_component_id(node) == expected_component_id; }));
for (const auto &node : view.Nodes())
{