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

@@ -274,8 +274,7 @@ UNIT_TEST(GetBestOsmNode_Test)
TEST(osmResponse.load_buffer(osmRawResponseNode, ::strlen(osmRawResponseNode)), ());
auto const bestNode = matcher::GetBestOsmNode(osmResponse, ms::LatLon(53.8977398, 27.5579251));
TEST_EQUAL(editor::XMLFeature(bestNode).GetName(),
"Главное управление капитального строительства", ());
TEST_EQUAL(editor::XMLFeature(bestNode).GetName(), "Главное управление капитального строительства", ());
}
{
pugi::xml_document osmResponse;
@@ -292,16 +291,11 @@ UNIT_TEST(GetBestOsmWay_Test)
pugi::xml_document osmResponse;
TEST(osmResponse.load_buffer(osmRawResponseWay, ::strlen(osmRawResponseWay)), ());
std::vector<m2::PointD> const geometry = {
{27.557515856307106, 64.236609073256034},
{27.55784576801841, 64.236820967769773},
{27.557352241556003, 64.236863883114324},
{27.55784576801841, 64.236820967769773},
{27.557352241556003, 64.236863883114324},
{27.557765301747366, 64.236963124848614},
{27.557352241556003, 64.236863883114324},
{27.557765301747366, 64.236963124848614},
{27.55768215326728, 64.237078459837136}
};
{27.557515856307106, 64.236609073256034}, {27.55784576801841, 64.236820967769773},
{27.557352241556003, 64.236863883114324}, {27.55784576801841, 64.236820967769773},
{27.557352241556003, 64.236863883114324}, {27.557765301747366, 64.236963124848614},
{27.557352241556003, 64.236863883114324}, {27.557765301747366, 64.236963124848614},
{27.55768215326728, 64.237078459837136}};
auto const bestWay = matcher::GetBestOsmWayOrRelation(osmResponse, geometry);
TEST(bestWay, ());
@@ -312,16 +306,11 @@ UNIT_TEST(GetBestOsmWay_Test)
TEST(osmResponse.load_buffer(osmRawResponseWay, ::strlen(osmRawResponseWay)), ());
// Each point is moved for 0.0001 on x and y. It is aboout a half of side length.
std::vector<m2::PointD> const geometry = {
{27.557615856307106, 64.236709073256034},
{27.55794576801841, 64.236920967769773},
{27.557452241556003, 64.236963883114324},
{27.55794576801841, 64.236920967769773},
{27.557452241556003, 64.236963883114324},
{27.557865301747366, 64.237063124848614},
{27.557452241556003, 64.236963883114324},
{27.557865301747366, 64.237063124848614},
{27.55778215326728, 64.237178459837136}
};
{27.557615856307106, 64.236709073256034}, {27.55794576801841, 64.236920967769773},
{27.557452241556003, 64.236963883114324}, {27.55794576801841, 64.236920967769773},
{27.557452241556003, 64.236963883114324}, {27.557865301747366, 64.237063124848614},
{27.557452241556003, 64.236963883114324}, {27.557865301747366, 64.237063124848614},
{27.55778215326728, 64.237178459837136}};
auto const bestWay = matcher::GetBestOsmWayOrRelation(osmResponse, geometry);
TEST(!bestWay, ());
@@ -333,76 +322,41 @@ UNIT_TEST(GetBestOsmRealtion_Test)
pugi::xml_document osmResponse;
TEST(osmResponse.load_buffer(osmRawResponseRelation, ::strlen(osmRawResponseRelation)), ());
std::vector<m2::PointD> const geometry = {
{37.640253436865322, 67.455316241497655},
{37.64019442826654, 67.455394025559684},
{37.640749645536772, 67.455726619480004},
{37.640253436865322, 67.455316241497655},
{37.640749645536772, 67.455726619480004},
{37.64069063693799, 67.455281372780206},
{37.640253436865322, 67.455316241497655},
{37.64069063693799, 67.455281372780206},
{37.640505564514598, 67.455174084418815},
{37.640253436865322, 67.455316241497655},
{37.640505564514598, 67.455174084418815},
{37.640376818480917, 67.455053385012263},
{37.640253436865322, 67.455316241497655},
{37.640376818480917, 67.455053385012263},
{37.640320492091178, 67.454932685605684},
{37.640253436865322, 67.455316241497655},
{37.640320492091178, 67.454932685605684},
{37.640111279786453, 67.455147262328467},
{37.640111279786453, 67.455147262328467},
{37.640320492091178, 67.454932685605684},
{37.640046906769612, 67.454938050023742},
{37.640046906769612, 67.454938050023742},
{37.640320492091178, 67.454932685605684},
{37.640320492091178, 67.454811986199104},
{37.640046906769612, 67.454938050023742},
{37.640320492091178, 67.454811986199104},
{37.640105915368395, 67.454677875747365},
{37.640105915368395, 67.454677875747365},
{37.640320492091178, 67.454811986199104},
{37.64035804301767, 67.454704697837713},
{37.640105915368395, 67.454677875747365},
{37.64035804301767, 67.454704697837713},
{37.64018101722138, 67.454508896578176},
{37.64018101722138, 67.454508896578176},
{37.64035804301767, 67.454704697837713},
{37.640663814847642, 67.454390879380639},
{37.64018101722138, 67.454508896578176},
{37.640663814847642, 67.454390879380639},
{37.640489471260366, 67.454173620448813},
{37.640489471260366, 67.454173620448813},
{37.640663814847642, 67.454390879380639},
{37.640634310548251, 67.454090471968726},
{37.640634310548251, 67.454090471968726},
{37.640663814847642, 67.454390879380639},
{37.640827429598772, 67.454321141945741},
{37.640634310548251, 67.454090471968726},
{37.640827429598772, 67.454321141945741},
{37.640787196463265, 67.454063649878378},
{37.640787196463265, 67.454063649878378},
{37.640827429598772, 67.454321141945741},
{37.64095349342341, 67.454079743132581},
{37.64095349342341, 67.454079743132581},
{37.640827429598772, 67.454321141945741},
{37.641001773186048, 67.454350646245103},
{37.64095349342341, 67.454079743132581},
{37.641001773186048, 67.454350646245103},
{37.641098332711294, 67.454152162776523},
{37.641098332711294, 67.454152162776523},
{37.641001773186048, 67.454350646245103},
{37.641243171999179, 67.45453303645948},
{37.641098332711294, 67.454152162776523},
{37.641243171999179, 67.45453303645948},
{37.641618681264049, 67.454541083086582},
{37.641618681264049, 67.454541083086582},
{37.641243171999179, 67.45453303645948},
{37.64069063693799, 67.455281372780206},
{37.641618681264049, 67.454541083086582},
{37.64069063693799, 67.455281372780206},
{37.640749645536772, 67.455726619480004}
};
{37.640253436865322, 67.455316241497655}, {37.64019442826654, 67.455394025559684},
{37.640749645536772, 67.455726619480004}, {37.640253436865322, 67.455316241497655},
{37.640749645536772, 67.455726619480004}, {37.64069063693799, 67.455281372780206},
{37.640253436865322, 67.455316241497655}, {37.64069063693799, 67.455281372780206},
{37.640505564514598, 67.455174084418815}, {37.640253436865322, 67.455316241497655},
{37.640505564514598, 67.455174084418815}, {37.640376818480917, 67.455053385012263},
{37.640253436865322, 67.455316241497655}, {37.640376818480917, 67.455053385012263},
{37.640320492091178, 67.454932685605684}, {37.640253436865322, 67.455316241497655},
{37.640320492091178, 67.454932685605684}, {37.640111279786453, 67.455147262328467},
{37.640111279786453, 67.455147262328467}, {37.640320492091178, 67.454932685605684},
{37.640046906769612, 67.454938050023742}, {37.640046906769612, 67.454938050023742},
{37.640320492091178, 67.454932685605684}, {37.640320492091178, 67.454811986199104},
{37.640046906769612, 67.454938050023742}, {37.640320492091178, 67.454811986199104},
{37.640105915368395, 67.454677875747365}, {37.640105915368395, 67.454677875747365},
{37.640320492091178, 67.454811986199104}, {37.64035804301767, 67.454704697837713},
{37.640105915368395, 67.454677875747365}, {37.64035804301767, 67.454704697837713},
{37.64018101722138, 67.454508896578176}, {37.64018101722138, 67.454508896578176},
{37.64035804301767, 67.454704697837713}, {37.640663814847642, 67.454390879380639},
{37.64018101722138, 67.454508896578176}, {37.640663814847642, 67.454390879380639},
{37.640489471260366, 67.454173620448813}, {37.640489471260366, 67.454173620448813},
{37.640663814847642, 67.454390879380639}, {37.640634310548251, 67.454090471968726},
{37.640634310548251, 67.454090471968726}, {37.640663814847642, 67.454390879380639},
{37.640827429598772, 67.454321141945741}, {37.640634310548251, 67.454090471968726},
{37.640827429598772, 67.454321141945741}, {37.640787196463265, 67.454063649878378},
{37.640787196463265, 67.454063649878378}, {37.640827429598772, 67.454321141945741},
{37.64095349342341, 67.454079743132581}, {37.64095349342341, 67.454079743132581},
{37.640827429598772, 67.454321141945741}, {37.641001773186048, 67.454350646245103},
{37.64095349342341, 67.454079743132581}, {37.641001773186048, 67.454350646245103},
{37.641098332711294, 67.454152162776523}, {37.641098332711294, 67.454152162776523},
{37.641001773186048, 67.454350646245103}, {37.641243171999179, 67.45453303645948},
{37.641098332711294, 67.454152162776523}, {37.641243171999179, 67.45453303645948},
{37.641618681264049, 67.454541083086582}, {37.641618681264049, 67.454541083086582},
{37.641243171999179, 67.45453303645948}, {37.64069063693799, 67.455281372780206},
{37.641618681264049, 67.454541083086582}, {37.64069063693799, 67.455281372780206},
{37.640749645536772, 67.455726619480004}};
auto const bestWay = matcher::GetBestOsmWayOrRelation(osmResponse, geometry);
TEST_EQUAL(bestWay.attribute("id").value(), std::string("365808"), ());
@@ -456,13 +410,9 @@ UNIT_TEST(HouseBuildingMiss_test)
pugi::xml_document osmResponse;
TEST(osmResponse.load_buffer(osmResponseBuildingMiss, ::strlen(osmResponseBuildingMiss)), ());
std::vector<m2::PointD> const geometry = {
{-0.2048121407986514, 60.333984198674443},
{-0.20478800091734684, 60.333909096821458},
{-0.20465925488366565, 60.334029796228037},
{-0.2048121407986514, 60.333984198674443},
{-0.20478800091734684, 60.333909096821458},
{-0.20463511500236109, 60.333954694375052}
};
{-0.2048121407986514, 60.333984198674443}, {-0.20478800091734684, 60.333909096821458},
{-0.20465925488366565, 60.334029796228037}, {-0.2048121407986514, 60.333984198674443},
{-0.20478800091734684, 60.333909096821458}, {-0.20463511500236109, 60.333954694375052}};
auto const bestWay = matcher::GetBestOsmWayOrRelation(osmResponse, geometry);
TEST_EQUAL(bestWay.attribute("id").value(), std::string("345630019"), ());
@@ -512,17 +462,12 @@ std::string const kHouseWithSeveralEntrances = R"xxx("
UNIT_TEST(HouseWithSeveralEntrances)
{
pugi::xml_document osmResponse;
TEST(osmResponse.load_buffer(kHouseWithSeveralEntrances.c_str(),
kHouseWithSeveralEntrances.size()), ());
TEST(osmResponse.load_buffer(kHouseWithSeveralEntrances.c_str(), kHouseWithSeveralEntrances.size()), ());
std::vector<m2::PointD> geometry = {
{37.570076119676798, 67.574481424499169},
{37.570258509891175, 67.574527022052763},
{37.569802534355233, 67.575570401367315},
{37.570258509891175, 67.574527022052763},
{37.569802534355233, 67.575570401367315},
{37.56998492456961, 67.57561599892091}
};
{37.570076119676798, 67.574481424499169}, {37.570258509891175, 67.574527022052763},
{37.569802534355233, 67.575570401367315}, {37.570258509891175, 67.574527022052763},
{37.569802534355233, 67.575570401367315}, {37.56998492456961, 67.57561599892091}};
auto const bestWay = matcher::GetBestOsmWayOrRelation(osmResponse, geometry);
TEST_EQUAL(bestWay.attribute("id").value(), std::string("30680719"), ());
@@ -565,13 +510,9 @@ UNIT_TEST(RelationWithSingleWay)
TEST(osmResponse.load_buffer(kRelationWithSingleWay.c_str(), kRelationWithSingleWay.size()), ());
std::vector<m2::PointD> geometry = {
{37.539920043497688, 67.533792313440074},
{37.539477479006933, 67.533234413960827},
{37.541207503834414, 67.532770391797811},
{37.539477479006933, 67.533234413960827},
{37.541207503834414, 67.532770391797811},
{37.54076493934366, 67.532212492318536}
};
{37.539920043497688, 67.533792313440074}, {37.539477479006933, 67.533234413960827},
{37.541207503834414, 67.532770391797811}, {37.539477479006933, 67.533234413960827},
{37.541207503834414, 67.532770391797811}, {37.54076493934366, 67.532212492318536}};
auto const bestWay = matcher::GetBestOsmWayOrRelation(osmResponse, geometry);
TEST_EQUAL(bestWay.attribute("id").value(), std::string("26232961"), ());
@@ -579,23 +520,9 @@ UNIT_TEST(RelationWithSingleWay)
UNIT_TEST(ScoreTriangulatedGeometries)
{
std::vector<m2::PointD> lhs = {
{0, 0},
{10, 10},
{10, 0},
{0, 0},
{10, 10},
{0, 10}
};
std::vector<m2::PointD> lhs = {{0, 0}, {10, 10}, {10, 0}, {0, 0}, {10, 10}, {0, 10}};
std::vector<m2::PointD> rhs = {
{-1, -1},
{9, 9},
{9, -1},
{-1, -1},
{9, 9},
{-1, 9}
};
std::vector<m2::PointD> rhs = {{-1, -1}, {9, 9}, {9, -1}, {-1, -1}, {9, 9}, {-1, 9}};
auto const score = matcher::ScoreTriangulatedGeometries(lhs, rhs);
TEST_GREATER(score, 0.6, ());