Enable more clang-tidy checks

This commit is contained in:
Siarhei Fedartsou 2022-06-30 10:59:43 +02:00
parent 8eecb9f3d6
commit 3a47d3100f
2 changed files with 10 additions and 12 deletions

View File

@ -7,25 +7,23 @@
#include <algorithm>
#include <vector>
using namespace osrm::util;
struct EdgeWithSomeAdditionalData
{
NodeID source;
NodeID target;
osrm::util::NodeID source;
osrm::util::NodeID target;
unsigned important_data;
};
inline Coordinate
makeCoordinate(int x, int y, double step_size, double offset_x = 0, double offset_y = 0)
{
return {FloatLongitude{offset_x + x * step_size}, FloatLatitude{offset_y + y * step_size}};
return {osrm::util::FloatLongitude{offset_x + x * step_size}, osrm::util::FloatLatitude{offset_y + y * step_size}};
}
std::vector<Coordinate> inline makeGridCoordinates(
std::vector<osrm::util::Coordinate> inline makeGridCoordinates(
int rows, int columns, double step_size, double lon_base, double lat_base)
{
std::vector<Coordinate> result;
std::vector<osrm::util::Coordinate> result;
for (int r = 0; r < rows; ++r)
for (int c = 0; c < columns; ++c)
@ -51,25 +49,25 @@ inline std::vector<EdgeWithSomeAdditionalData> makeGridEdges(int rows, int colum
if (c > 0)
{
auto left = get_id(r, c - 1);
edges.push_back({id, static_cast<NodeID>(left), 1});
edges.push_back({id, static_cast<osrm::util::NodeID>(left), 1});
}
if (c + 1 < columns)
{
auto right = get_id(r, c + 1);
if (valid(right))
edges.push_back({id, static_cast<NodeID>(right), 1});
edges.push_back({id, static_cast<osrm::util::NodeID>(right), 1});
}
if (r > 0)
{
auto top = get_id(r - 1, c);
if (valid(top))
edges.push_back({id, static_cast<NodeID>(top), 1});
edges.push_back({id, static_cast<osrm::util::NodeID>(top), 1});
}
if (r + 1 < rows)
{
auto bottom = get_id(r + 1, c);
if (valid(bottom))
edges.push_back({id, static_cast<NodeID>(bottom), 1});
edges.push_back({id, static_cast<osrm::util::NodeID>(bottom), 1});
}
}
}

View File

@ -17,7 +17,7 @@
#include <boost/test/unit_test.hpp>
#define CHECK_EQUAL_RANGE(R1, R2) \
BOOST_CHECK_EQUAL_COLLECTIONS(R1.begin(), R1.end(), R2.begin(), R2.end());
BOOST_CHECK_EQUAL_COLLECTIONS((R1).begin(), (R1).end(), (R2).begin(), (R2).end());
BOOST_AUTO_TEST_SUITE(api_parameters_parser)