Add clang-format (#1086)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
This commit is contained in:
Bart Louwers
2023-05-01 16:57:37 +02:00
committed by GitHub
parent 403a12bd1b
commit 71f6da2722
1018 changed files with 27876 additions and 25862 deletions

View File

@@ -16,9 +16,7 @@ static double _signedArea(const GeometryCoordinates& ring) {
}
TEST(GeometryTileData, classifyRings1) {
std::vector<GeometryCollection> polygons = classifyRings({
{ {0, 0}, {0, 40}, {40, 40}, {40, 0}, {0, 0} }
});
std::vector<GeometryCollection> polygons = classifyRings({{{0, 0}, {0, 40}, {40, 40}, {40, 0}, {0, 0}}});
// output: 1 polygon
ASSERT_EQ(polygons.size(), 1u);
@@ -27,10 +25,8 @@ TEST(GeometryTileData, classifyRings1) {
}
TEST(GeometryTileData, classifyRings2) {
std::vector<GeometryCollection> polygons = classifyRings({
{ {0, 0}, {0, 40}, {40, 40}, {40, 0}, {0, 0} },
{ {10, 10}, {20, 10}, {20, 20}, {10, 10} }
});
std::vector<GeometryCollection> polygons = classifyRings(
{{{0, 0}, {0, 40}, {40, 40}, {40, 0}, {0, 0}}, {{10, 10}, {20, 10}, {20, 20}, {10, 10}}});
// output: 1 polygon
ASSERT_EQ(polygons.size(), 1u);
@@ -39,11 +35,9 @@ TEST(GeometryTileData, classifyRings2) {
}
TEST(GeometryTileData, limitHoles1) {
GeometryCollection polygon = {
{ {0, 0}, {0, 40}, {40, 40}, {40, 0}, {0, 0} },
{ {30, 30}, {32, 30}, {32, 32}, {30, 30} },
{ {10, 10}, {20, 10}, {20, 20}, {10, 10} }
};
GeometryCollection polygon = {{{0, 0}, {0, 40}, {40, 40}, {40, 0}, {0, 0}},
{{30, 30}, {32, 30}, {32, 32}, {30, 30}},
{{10, 10}, {20, 10}, {20, 20}, {10, 10}}};
limitHoles(polygon, 1);
@@ -56,11 +50,9 @@ TEST(GeometryTileData, limitHoles1) {
}
TEST(GeometryTileData, limitHoles2) {
GeometryCollection polygon = {
{ {0, 0}, {0, 40}, {40, 40}, {40, 0}, {0, 0} },
{ {10, 10}, {20, 10}, {20, 20}, {10, 10} },
{ {30, 30}, {32, 30}, {32, 32}, {30, 30} }
};
GeometryCollection polygon = {{{0, 0}, {0, 40}, {40, 40}, {40, 0}, {0, 0}},
{{10, 10}, {20, 10}, {20, 20}, {10, 10}},
{{30, 30}, {32, 30}, {32, 32}, {30, 30}}};
limitHoles(polygon, 1);
@@ -77,11 +69,15 @@ TEST(GeometryTileData, limitHoles3) {
// that need to be sorted in `limitHoles` by comparing absolute
// area not signed
GeometryCollection polygon = {
{ {7336,-248},{7304,-248},{7272,-168},{7176,-200},{7080,-136},{7048,-56},{7128,-8},{7176,-56},{7288,-56},{7316,0},{6918,0},{6904,-40},{6984,-72},{6952,-88},{6952,-168},{6888,-88},{6856,-88},{6856,-8},{6872,0},{6170,0},{6184,-40},{6136,-72},{6104,-56},{6132,0},{6028,0},{6104,-152},{6184,-200},{6206,-256},{6272,-256},{6264,-248},{6248,-120},{6280,-136},{6280,-232},{6288,-256},{6790,-256},{6792,-248},{6800,-256},{7058,-256},{7064,-248},{7096,-256},{7338,-256},{7336,-248} },
{ {6344,-104},{6264,-8},{6392,-72},{6360,-200},{6344,-104} },
{ {6744,-24},{6760,-72},{6728,-104},{6744,-24} },
{ {6616,-104},{6648,-88},{6632,-72},{6664,-56},{6664,-120},{6616,-104} }
};
{{7336, -248}, {7304, -248}, {7272, -168}, {7176, -200}, {7080, -136}, {7048, -56}, {7128, -8},
{7176, -56}, {7288, -56}, {7316, 0}, {6918, 0}, {6904, -40}, {6984, -72}, {6952, -88},
{6952, -168}, {6888, -88}, {6856, -88}, {6856, -8}, {6872, 0}, {6170, 0}, {6184, -40},
{6136, -72}, {6104, -56}, {6132, 0}, {6028, 0}, {6104, -152}, {6184, -200}, {6206, -256},
{6272, -256}, {6264, -248}, {6248, -120}, {6280, -136}, {6280, -232}, {6288, -256}, {6790, -256},
{6792, -248}, {6800, -256}, {7058, -256}, {7064, -248}, {7096, -256}, {7338, -256}, {7336, -248}},
{{6344, -104}, {6264, -8}, {6392, -72}, {6360, -200}, {6344, -104}},
{{6744, -24}, {6760, -72}, {6728, -104}, {6744, -24}},
{{6616, -104}, {6648, -88}, {6632, -72}, {6664, -56}, {6664, -120}, {6616, -104}}};
// make a copy for later testing
GeometryCollection original(polygon);
@@ -103,5 +99,4 @@ TEST(GeometryTileData, limitHoles3) {
// ensure we've kept the two largest interior rings
ASSERT_EQ(original.at(1), polygon.at(1));
ASSERT_EQ(original.at(3), polygon.at(2));
}