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

@@ -33,9 +33,8 @@ UNIT_TEST(ReadJson_Network)
"title":"Caltrain"
})"};
std::vector<Network> const networksPlan = {
Network(4032061478 /* transitId */, "Tránsito Golden Gate" /* title */),
Network(4035419389 /* transitId */, "Caltrain" /* title */)};
std::vector<Network> const networksPlan = {Network(4032061478 /* transitId */, "Tránsito Golden Gate" /* title */),
Network(4035419389 /* transitId */, "Caltrain" /* title */)};
std::vector<Network> networksFact;
@@ -61,11 +60,10 @@ UNIT_TEST(ReadJson_Route)
"title":"East Route"
})"};
std::vector<Route> const routesPlan = {
Route(4036206863 /* id */, 4036206862 /* networkId */, "rail" /* routeType */,
"Línea principal" /* title */, "pink_dark" /* color */),
Route(4027700598 /* id */, 4027700597 /* networkId */, "bus" /* routeType */,
"East Route" /* title */, "blue" /* color */)};
std::vector<Route> const routesPlan = {Route(4036206863 /* id */, 4036206862 /* networkId */, "rail" /* routeType */,
"Línea principal" /* title */, "pink_dark" /* color */),
Route(4027700598 /* id */, 4027700597 /* networkId */, "bus" /* routeType */,
"East Route" /* title */, "blue" /* color */)};
std::vector<Route> routesFact;
@@ -114,10 +112,10 @@ UNIT_TEST(ReadJson_Line)
schedule.AddDateException(DateException(519), {});
schedule.AddDateException(DateException(357), {});
std::vector<Line> const linesPlan = {
Line(4036591532 /* id */, 4036591423 /* routeId */,
ShapeLink(4036591460 /* id */, 415 /* startIndex */, 1691 /* endIndex */),
"Downtown" /* title */, IdList{4036592571, 4036592572, 4036592573}, schedule)};
std::vector<Line> const linesPlan = {Line(4036591532 /* id */, 4036591423 /* routeId */,
ShapeLink(4036591460 /* id */, 415 /* startIndex */, 1691 /* endIndex */),
"Downtown" /* title */, IdList{4036592571, 4036592572, 4036592573},
schedule)};
std::vector<Line> linesFact;
@@ -144,9 +142,8 @@ UNIT_TEST(ReadJson_LineMetadata)
]
})"};
std::vector<LineMetadata> const linesMetadataPlan = {LineMetadata(
56 /* id */,
LineSegmentsOrder{LineSegmentOrder({34, 99}, -1), LineSegmentOrder({99, 1069}, -3)})};
std::vector<LineMetadata> const linesMetadataPlan = {
LineMetadata(56 /* id */, LineSegmentsOrder{LineSegmentOrder({34, 99}, -1), LineSegmentOrder({99, 1069}, -3)})};
std::vector<LineMetadata> linesMetadataFact;
@@ -173,8 +170,7 @@ UNIT_TEST(ReadJson_Stop)
std::vector<Stop> const stopsPlan = {
Stop(4036592706 /* id */, kInvalidFeatureId /* featureId */, kInvalidOsmId /* osmId */,
"Balfour Rd & Foothill Dr",
TimeTable{{204, std::vector<TimeInterval>{TimeInterval(11400205248)}}},
"Balfour Rd & Foothill Dr", TimeTable{{204, std::vector<TimeInterval>{TimeInterval(11400205248)}}},
m2::PointD(-121.74124, 41.04276), {4036593809, 4036595406} /* transferIds */)};
std::vector<Stop> stopsFact;
@@ -208,11 +204,10 @@ UNIT_TEST(ReadJson_Gate)
})"};
std::vector<Gate> const gatesPlan = {
Gate(4034666808 /* id */, kInvalidFeatureId /* featureId */, kInvalidOsmId /* osmId */,
true /* entrance */, true /* exit */,
std::vector<TimeFromGateToStop>{
TimeFromGateToStop(4034666299 /* stopId */, 76 /* timeSeconds */),
TimeFromGateToStop(4034666190 /* stopId */, 61 /* timeSeconds */)},
Gate(4034666808 /* id */, kInvalidFeatureId /* featureId */, kInvalidOsmId /* osmId */, true /* entrance */,
true /* exit */,
std::vector<TimeFromGateToStop>{TimeFromGateToStop(4034666299 /* stopId */, 76 /* timeSeconds */),
TimeFromGateToStop(4034666190 /* stopId */, 61 /* timeSeconds */)},
m2::PointD(-121.8406, 40.19395))};
std::vector<Gate> gatesFact;
@@ -246,12 +241,10 @@ UNIT_TEST(ReadJson_Edge)
)"};
std::vector<Edge> const edgesPlan = {
Edge(4036592295 /* stop1Id */, 4036592296 /* stop2Id */, 69 /* weight */,
4036591958 /* lineId */, false /* transfer */,
ShapeLink(4036591484 /* shapeId */, 592 /* startIndex */, 609 /* endIndex */)),
Edge(4030648032 /* stop1Id */, 4030648073 /* stop2Id */, 40 /* weight */,
kInvalidTransitId /* lineId */, true /* transfer */,
ShapeLink(kInvalidTransitId /* shapeId */, 0 /* startIndex */, 0 /* endIndex */))};
Edge(4036592295 /* stop1Id */, 4036592296 /* stop2Id */, 69 /* weight */, 4036591958 /* lineId */,
false /* transfer */, ShapeLink(4036591484 /* shapeId */, 592 /* startIndex */, 609 /* endIndex */)),
Edge(4030648032 /* stop1Id */, 4030648073 /* stop2Id */, 40 /* weight */, kInvalidTransitId /* lineId */,
true /* transfer */, ShapeLink(kInvalidTransitId /* shapeId */, 0 /* startIndex */, 0 /* endIndex */))};
std::vector<Edge> edgesFact;
EdgeIdToFeatureId edgeIdToFeatureId;
@@ -276,9 +269,8 @@ UNIT_TEST(ReadJson_Transfer)
}
)"};
std::vector<Transfer> const transfersPlan = {
Transfer(4029752024 /* id */, m2::PointD(-122.16915, 40.41578) /* point */,
IdList{4029751945, 4029752010} /* stopIds */)};
std::vector<Transfer> const transfersPlan = {Transfer(
4029752024 /* id */, m2::PointD(-122.16915, 40.41578) /* point */, IdList{4029751945, 4029752010} /* stopIds */)};
std::vector<Transfer> transfersFact;

View File

@@ -22,8 +22,7 @@ enum class TransitUseCase
CrossMwm
};
void TestEqual(TransitData const & actualTransit, TransitData const & expectedTransit,
TransitUseCase const & useCase)
void TestEqual(TransitData const & actualTransit, TransitData const & expectedTransit, TransitUseCase const & useCase)
{
switch (useCase)
{
@@ -99,10 +98,9 @@ void SerDesTransit(TransitData & src, TransitData & dst, TransitUseCase const &
TransitData FillTestTransitData()
{
TransitData data;
data.m_networks = {
Network(4032061671 /* transitId */, "ГУП МосГорТранс" /* title */),
Network(4035419440 /* transitId */, "EMPRESA DE TRANSPORTE DEL SUR SRL" /* title */),
Network(4035418196 /* transitId */, "Buslink Sunraysia" /* title */)};
data.m_networks = {Network(4032061671 /* transitId */, "ГУП МосГорТранс" /* title */),
Network(4035419440 /* transitId */, "EMPRESA DE TRANSPORTE DEL SUR SRL" /* title */),
Network(4035418196 /* transitId */, "Buslink Sunraysia" /* title */)};
data.m_routes = {Route(4036206872 /* id */, 4035419440 /* networkId */, "bus" /* routeType */,
"Echuca/Moama - Melbourne Via Shepparton" /* title */, "gray" /* color */),
@@ -119,73 +117,59 @@ TransitData FillTestTransitData()
schedule.AddDatesInterval(DatesInterval(75007489), frequencies);
data.m_lines = {
Line(4036598626 /* id */, 4036206872 /* routeId */,
ShapeLink(4036591460 /* id */, 0 /* startIndex */, 2690 /* endIndex */),
"740G" /* title */,
IdList{4036592571, 4036592572, 4036592573, 4036592574, 4036592575, 4036592576},
schedule),
Line(
4036598627 /* id */, 4036206872 /* routeId */,
ShapeLink(4036591461 /* id */, 356 /* startIndex */, 40690 /* endIndex */),
"" /* title */,
IdList{4027013783, 4027013784, 4027013785, 4027013786, 4027013787, 4027013788, 4027013789,
4027013790, 4027013791, 4027013792, 4027013793, 4027013794, 4027013795, 4027013796,
4027013797, 4027013798, 4027013799, 4027013800, 4027013801},
schedule)};
data.m_lines = {Line(4036598626 /* id */, 4036206872 /* routeId */,
ShapeLink(4036591460 /* id */, 0 /* startIndex */, 2690 /* endIndex */), "740G" /* title */,
IdList{4036592571, 4036592572, 4036592573, 4036592574, 4036592575, 4036592576}, schedule),
Line(4036598627 /* id */, 4036206872 /* routeId */,
ShapeLink(4036591461 /* id */, 356 /* startIndex */, 40690 /* endIndex */), "" /* title */,
IdList{4027013783, 4027013784, 4027013785, 4027013786, 4027013787, 4027013788, 4027013789,
4027013790, 4027013791, 4027013792, 4027013793, 4027013794, 4027013795, 4027013796,
4027013797, 4027013798, 4027013799, 4027013800, 4027013801},
schedule)};
data.m_linesMetadata = {
LineMetadata(4036598626 /* id */, LineSegmentsOrder{LineSegmentOrder({0, 100}, 0),
LineSegmentOrder({100, 205}, 2)}),
LineMetadata(4036598627 /* id */, LineSegmentsOrder{})};
data.m_linesMetadata = {LineMetadata(4036598626 /* id */, LineSegmentsOrder{LineSegmentOrder({0, 100}, 0),
LineSegmentOrder({100, 205}, 2)}),
LineMetadata(4036598627 /* id */, LineSegmentsOrder{})};
data.m_stops = {Stop(4026990853 /* id */, kInvalidFeatureId /* featureId */,
kInvalidOsmId /* osmId */, "CARLOS DIHEL 2500-2598" /* title */,
TimeTable{{204, std::vector<TimeInterval>{TimeInterval(11400205248)}}},
m2::PointD(-58.57196, -36.82596), {} /* transferIds */),
Stop(4026990854 /* id */, kInvalidFeatureId /* featureId */,
kInvalidOsmId /* osmId */, "QUIROGA 1901-1999" /* title */, TimeTable{},
m2::PointD(-58.57196, -36.82967), {} /* transferIds */)};
data.m_stops = {
Stop(4026990853 /* id */, kInvalidFeatureId /* featureId */, kInvalidOsmId /* osmId */,
"CARLOS DIHEL 2500-2598" /* title */, TimeTable{{204, std::vector<TimeInterval>{TimeInterval(11400205248)}}},
m2::PointD(-58.57196, -36.82596), {} /* transferIds */),
Stop(4026990854 /* id */, kInvalidFeatureId /* featureId */, kInvalidOsmId /* osmId */,
"QUIROGA 1901-1999" /* title */, TimeTable{}, m2::PointD(-58.57196, -36.82967), {} /* transferIds */)};
data.SetStopPedestrianSegments(
0 /* stopIdx */,
{SingleMwmSegment(981 /* featureId */, 0 /* segmentIdx */, true /* forward */),
SingleMwmSegment(91762 /* featureId */, 108 /* segmentIdx */, false /* forward */)});
data.SetStopPedestrianSegments(
1 /* stopIdx */,
{SingleMwmSegment(15000 /* featureId */, 100 /* segmentIdx */, false /* forward */)});
data.SetStopPedestrianSegments(0 /* stopIdx */,
{SingleMwmSegment(981 /* featureId */, 0 /* segmentIdx */, true /* forward */),
SingleMwmSegment(91762 /* featureId */, 108 /* segmentIdx */, false /* forward */)});
data.SetStopPedestrianSegments(1 /* stopIdx */,
{SingleMwmSegment(15000 /* featureId */, 100 /* segmentIdx */, false /* forward */)});
data.m_gates = {Gate(4034666808 /* id */, kInvalidFeatureId /* featureId */,
kInvalidOsmId /* osmId */, true /* entrance */, true /* exit */,
std::vector<TimeFromGateToStop>{
TimeFromGateToStop(4026990854 /* stopId */, 76 /* timeSeconds */)},
m2::PointD(-121.84063, 40.19393)),
Gate(4034666809 /* id */, kInvalidFeatureId /* featureId */,
kInvalidOsmId /* osmId */, false /* entrance */, true /* exit */,
std::vector<TimeFromGateToStop>{
TimeFromGateToStop(4026990857 /* stopId */, 0 /* timeSeconds */),
TimeFromGateToStop(4026990858 /* stopId */, 0 /* timeSeconds */)},
m2::PointD(-58.96030, -36.40335)),
Gate(4034666810 /* id */, kInvalidFeatureId /* featureId */,
kInvalidOsmId /* osmId */, true /* entrance */, false /* exit */,
std::vector<TimeFromGateToStop>{
TimeFromGateToStop(4026990889 /* stopId */, 80 /* timeSeconds */),
TimeFromGateToStop(4026990890 /* stopId */, 108 /* timeSeconds */),
TimeFromGateToStop(4026990891 /* stopId */, 90 /* timeSeconds */)},
m2::PointD(-58.96030, -36.40335))};
data.m_gates = {
Gate(4034666808 /* id */, kInvalidFeatureId /* featureId */, kInvalidOsmId /* osmId */, true /* entrance */,
true /* exit */,
std::vector<TimeFromGateToStop>{TimeFromGateToStop(4026990854 /* stopId */, 76 /* timeSeconds */)},
m2::PointD(-121.84063, 40.19393)),
Gate(4034666809 /* id */, kInvalidFeatureId /* featureId */, kInvalidOsmId /* osmId */, false /* entrance */,
true /* exit */,
std::vector<TimeFromGateToStop>{TimeFromGateToStop(4026990857 /* stopId */, 0 /* timeSeconds */),
TimeFromGateToStop(4026990858 /* stopId */, 0 /* timeSeconds */)},
m2::PointD(-58.96030, -36.40335)),
Gate(4034666810 /* id */, kInvalidFeatureId /* featureId */, kInvalidOsmId /* osmId */, true /* entrance */,
false /* exit */,
std::vector<TimeFromGateToStop>{TimeFromGateToStop(4026990889 /* stopId */, 80 /* timeSeconds */),
TimeFromGateToStop(4026990890 /* stopId */, 108 /* timeSeconds */),
TimeFromGateToStop(4026990891 /* stopId */, 90 /* timeSeconds */)},
m2::PointD(-58.96030, -36.40335))};
data.SetGatePedestrianSegments(
1 /* gateIdx */,
{SingleMwmSegment(6861 /* featureId */, 15 /* segmentIdx */, true /* forward */),
SingleMwmSegment(307920 /* featureId */, 2 /* segmentIdx */, false /* forward */)});
data.SetGatePedestrianSegments(1 /* gateIdx */,
{SingleMwmSegment(6861 /* featureId */, 15 /* segmentIdx */, true /* forward */),
SingleMwmSegment(307920 /* featureId */, 2 /* segmentIdx */, false /* forward */)});
data.m_edges = {
Edge(4036592295 /* stop1Id */, 4036592296 /* stop2Id */, 69 /* weight */,
4036591958 /* lineId */, false /* transfer */,
ShapeLink(4036591484 /* shapeId */, 592 /* startIndex */, 609 /* endIndex */)),
Edge(4030648032 /* stop1Id */, 4030648073 /* stop2Id */, 40 /* weight */,
kInvalidTransitId /* lineId */, true /* transfer */,
ShapeLink(kInvalidTransitId /* shapeId */, 0 /* startIndex */, 0 /* endIndex */))};
Edge(4036592295 /* stop1Id */, 4036592296 /* stop2Id */, 69 /* weight */, 4036591958 /* lineId */,
false /* transfer */, ShapeLink(4036591484 /* shapeId */, 592 /* startIndex */, 609 /* endIndex */)),
Edge(4030648032 /* stop1Id */, 4030648073 /* stop2Id */, 40 /* weight */, kInvalidTransitId /* lineId */,
true /* transfer */, ShapeLink(kInvalidTransitId /* shapeId */, 0 /* startIndex */, 0 /* endIndex */))};
data.m_transfers = {Transfer(4029752024 /* id */, m2::PointD(-122.16915, 40.41578) /* point */,
IdList{4029751945, 4029752010} /* stopIds */)};