mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 21:33:59 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
#include "map/elevation_info.hpp"
|
||||
|
||||
#include "geometry/point_with_altitude.hpp"
|
||||
#include "geometry/mercator.hpp"
|
||||
#include "geometry/point_with_altitude.hpp"
|
||||
|
||||
#include "kml/types.hpp"
|
||||
|
||||
@@ -33,11 +33,7 @@ UNIT_TEST(ElevationInfo_FromMultiGeometry)
|
||||
auto const point1 = PointWithAltitude({0.0, 0.0}, 100);
|
||||
auto const point2 = PointWithAltitude({1.0, 1.0}, 150);
|
||||
auto const point3 = PointWithAltitude({2.0, 2.0}, 50);
|
||||
geometry.AddLine({
|
||||
point1,
|
||||
point2,
|
||||
point3
|
||||
});
|
||||
geometry.AddLine({point1, point2, point3});
|
||||
ElevationInfo ei(geometry.m_lines);
|
||||
|
||||
TEST_EQUAL(3, ei.GetSize(), ());
|
||||
@@ -53,20 +49,11 @@ UNIT_TEST(ElevationInfo_FromMultiGeometry)
|
||||
UNIT_TEST(ElevationInfo_MultipleLines)
|
||||
{
|
||||
kml::MultiGeometry geometry;
|
||||
geometry.AddLine({
|
||||
PointWithAltitude({0.0, 0.0}, 100),
|
||||
PointWithAltitude({1.0, 1.0}, 150),
|
||||
PointWithAltitude({1.0, 1.0}, 140)
|
||||
});
|
||||
geometry.AddLine({
|
||||
PointWithAltitude({2.0, 2.0}, 50),
|
||||
PointWithAltitude({3.0, 3.0}, 75),
|
||||
PointWithAltitude({3.0, 3.0}, 60)
|
||||
});
|
||||
geometry.AddLine({
|
||||
PointWithAltitude({4.0, 4.0}, 200),
|
||||
PointWithAltitude({5.0, 5.0}, 250)
|
||||
});
|
||||
geometry.AddLine(
|
||||
{PointWithAltitude({0.0, 0.0}, 100), PointWithAltitude({1.0, 1.0}, 150), PointWithAltitude({1.0, 1.0}, 140)});
|
||||
geometry.AddLine(
|
||||
{PointWithAltitude({2.0, 2.0}, 50), PointWithAltitude({3.0, 3.0}, 75), PointWithAltitude({3.0, 3.0}, 60)});
|
||||
geometry.AddLine({PointWithAltitude({4.0, 4.0}, 200), PointWithAltitude({5.0, 5.0}, 250)});
|
||||
ElevationInfo ei(geometry.m_lines);
|
||||
|
||||
TEST_EQUAL(8, ei.GetSize(), ());
|
||||
@@ -75,18 +62,9 @@ UNIT_TEST(ElevationInfo_MultipleLines)
|
||||
UNIT_TEST(ElevationInfo_SegmentDistances)
|
||||
{
|
||||
kml::MultiGeometry geometry;
|
||||
geometry.AddLine({
|
||||
PointWithAltitude({0.0, 0.0}),
|
||||
PointWithAltitude({1.0, 0.0})
|
||||
});
|
||||
geometry.AddLine({
|
||||
PointWithAltitude({2.0, 0.0}),
|
||||
PointWithAltitude({3.0, 0.0})
|
||||
});
|
||||
geometry.AddLine({
|
||||
PointWithAltitude({4.0, 0.0}),
|
||||
PointWithAltitude({5.0, 0.0})
|
||||
});
|
||||
geometry.AddLine({PointWithAltitude({0.0, 0.0}), PointWithAltitude({1.0, 0.0})});
|
||||
geometry.AddLine({PointWithAltitude({2.0, 0.0}), PointWithAltitude({3.0, 0.0})});
|
||||
geometry.AddLine({PointWithAltitude({4.0, 0.0}), PointWithAltitude({5.0, 0.0})});
|
||||
|
||||
ElevationInfo ei(geometry.m_lines);
|
||||
auto const & segmentDistances = ei.GetSegmentsDistances();
|
||||
@@ -101,19 +79,15 @@ UNIT_TEST(ElevationInfo_BuildWithGpsPoints)
|
||||
{
|
||||
auto ei = ElevationInfo();
|
||||
ei.AddGpsPoints({
|
||||
BuildGpsInfo(0.0, 0.0, 0),
|
||||
BuildGpsInfo(1.0, 1.0, 50),
|
||||
BuildGpsInfo(2.0, 2.0, 100),
|
||||
});
|
||||
ei.AddGpsPoints({
|
||||
BuildGpsInfo(3.0, 3.0, -50)
|
||||
});
|
||||
ei.AddGpsPoints({
|
||||
BuildGpsInfo(4.0, 4.0, 0)
|
||||
BuildGpsInfo(0.0, 0.0, 0),
|
||||
BuildGpsInfo(1.0, 1.0, 50),
|
||||
BuildGpsInfo(2.0, 2.0, 100),
|
||||
});
|
||||
ei.AddGpsPoints({BuildGpsInfo(3.0, 3.0, -50)});
|
||||
ei.AddGpsPoints({BuildGpsInfo(4.0, 4.0, 0)});
|
||||
ei.AddGpsPoints({});
|
||||
|
||||
TEST_EQUAL(5, ei.GetSize(), ());
|
||||
TEST_EQUAL(ei.GetSegmentsDistances().size(), 0, ());
|
||||
}
|
||||
} // namespace elevation_info_testa
|
||||
} // namespace elevation_info_tests
|
||||
|
||||
Reference in New Issue
Block a user