Format all C++ and Java code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 14:32:37 +07:00
parent 9f0290c0ec
commit bfffa1fff4
2169 changed files with 56441 additions and 64188 deletions

View File

@@ -75,10 +75,8 @@ std::vector<CameraMapItem> UnpackMapToVector(CameraMap const & cameraMap)
{
std::vector<CameraMapItem> result;
for (auto const & mapIter : cameraMap)
{
for (auto const & vectorIter : mapIter.second)
result.push_back({mapIter.first, vectorIter});
}
sort(result.begin(), result.end());
return result;
@@ -101,8 +99,7 @@ void CheckCameraMapsEquality(CameraMap const & lhs, CameraMap const & rhs, doubl
}
}
void TestSpeedCameraSectionBuilding(string const & osmContent, CameraMap const & answer,
double epsilon)
void TestSpeedCameraSectionBuilding(string const & osmContent, CameraMap const & answer, double epsilon)
{
// ScopedFile takes relative path only?! and makes WritableDir() + kOsmFileName.
// Replace WritebleDir here with temporary path.
@@ -189,9 +186,7 @@ UNIT_TEST(SpeedCameraGenerationTest_CameraIsOnePointOfFeature_1)
// coef - position on segment (at the beginning of segment) - 0,
// maxSpeed - 100.
CameraMap const answer = {
{SegmentCoord(0, 0), std::vector<RouteSegment::SpeedCamera>{{0, 100}}}
};
CameraMap const answer = {{SegmentCoord(0, 0), std::vector<RouteSegment::SpeedCamera>{{0, 100}}}};
TestSpeedCameraSectionBuilding(osmContent, answer, kCoefEqualityEpsilon);
}
@@ -222,9 +217,7 @@ UNIT_TEST(SpeedCameraGenerationTest_CameraIsOnePointOfFeature_2)
// coef - position on segment (at the beginning of segment) - 0,
// maxSpeed - 100.
CameraMap const answer = {
{SegmentCoord(0, 1), std::vector<RouteSegment::SpeedCamera>{{0, 100}}}
};
CameraMap const answer = {{SegmentCoord(0, 1), std::vector<RouteSegment::SpeedCamera>{{0, 100}}}};
TestSpeedCameraSectionBuilding(osmContent, answer, kCoefEqualityEpsilon);
}
@@ -255,9 +248,7 @@ UNIT_TEST(SpeedCameraGenerationTest_CameraIsOnePointOfFeature_3)
// coef - position on segment (at the end of segment) - 1,
// maxSpeed - 100.
CameraMap const answer = {
{SegmentCoord(0, 1), std::vector<RouteSegment::SpeedCamera>{{1, 100}}}
};
CameraMap const answer = {{SegmentCoord(0, 1), std::vector<RouteSegment::SpeedCamera>{{1, 100}}}};
TestSpeedCameraSectionBuilding(osmContent, answer, kCoefEqualityEpsilon);
}
@@ -311,10 +302,8 @@ UNIT_TEST(SpeedCameraGenerationTest_CameraIsOnePointOfFeature_4)
// coef - position on segment (at the beginning of segment) - 0,
// maxSpeed - 100.
CameraMap const answer = {
{SegmentCoord(0, 1), std::vector<RouteSegment::SpeedCamera>{{1, 100}}},
{SegmentCoord(1, 1), std::vector<RouteSegment::SpeedCamera>{{0, 100}}}
};
CameraMap const answer = {{SegmentCoord(0, 1), std::vector<RouteSegment::SpeedCamera>{{1, 100}}},
{SegmentCoord(1, 1), std::vector<RouteSegment::SpeedCamera>{{0, 100}}}};
TestSpeedCameraSectionBuilding(osmContent, answer, kCoefEqualityEpsilon);
}
@@ -353,8 +342,7 @@ UNIT_TEST(SpeedCameraGenerationTest_CameraIsNearFeature_1)
mercator::DistanceOnEarth(mercator::FromLatLon(55.7793100, 37.3699100),
mercator::FromLatLon(55.7793300, 37.3699300));
epsilon = math::Clamp(epsilon, 0.0, 1.0);
CameraMap const answer = {
{SegmentCoord(0, 0), std::vector<RouteSegment::SpeedCamera>{{0.5, 100}}}};
CameraMap const answer = {{SegmentCoord(0, 0), std::vector<RouteSegment::SpeedCamera>{{0.5, 100}}}};
TestSpeedCameraSectionBuilding(osmContent, answer, epsilon);
}
@@ -391,9 +379,7 @@ UNIT_TEST(SpeedCameraGenerationTest_CameraIsNearFeature_2)
mercator::FromLatLon(55.7793300, 37.3699300));
epsilon = math::Clamp(epsilon, 0.0, 1.0);
CameraMap const answer = {
{SegmentCoord(0, 0), std::vector<RouteSegment::SpeedCamera>{{0.25, 100}}}
};
CameraMap const answer = {{SegmentCoord(0, 0), std::vector<RouteSegment::SpeedCamera>{{0.25, 100}}}};
TestSpeedCameraSectionBuilding(osmContent, answer, epsilon);
}