Skip to content

Commit

Permalink
Fixed clang errors
Browse files Browse the repository at this point in the history
  • Loading branch information
papafe committed Jun 1, 2023
1 parent b654240 commit 8d63d3c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions test/object-store/sync/flx_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1465,8 +1465,8 @@ TEST_CASE("flx: geospatial", "[sync][flx][app]") {
REQUIRE(point.latitude == points[0].latitude);
REQUIRE(!point.get_altitude());
ColKey location_col = table->get_column_key("location");
GeoPolygon bounds{{
{GeoPoint{-80, 40.7128}, GeoPoint{20, 60}, GeoPoint{20, 20}, GeoPoint{-80, 40.7128}}}};
GeoPolygon bounds{
{{GeoPoint{-80, 40.7128}, GeoPoint{20, 60}, GeoPoint{20, 20}, GeoPoint{-80, 40.7128}}}};
Query query = table->column<Link>(location_col).geo_within(Geospatial(bounds));
size_t local_matches = query.find_all().size();
REQUIRE(local_matches == 2);
Expand Down
3 changes: 2 additions & 1 deletion test/test_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5732,7 +5732,8 @@ TEST(Parser_Geospatial)

Geospatial box{GeoBox{GeoPoint{0.2, 0.2}, GeoPoint{0.7, 0.7}}};
Geospatial circle{GeoCircle{1, GeoPoint{0.3, 0.3}}};
Geospatial polygon{GeoPolygon{{{GeoPoint{0, 0}, GeoPoint{1, 0}, GeoPoint{1, 1}, GeoPoint{0, 1}, GeoPoint{0, 0}}}}};
Geospatial polygon{
GeoPolygon{{{GeoPoint{0, 0}, GeoPoint{1, 0}, GeoPoint{1, 1}, GeoPoint{0, 1}, GeoPoint{0, 0}}}}};
Geospatial invalid;
Geospatial point{GeoPoint{0, 0}};
std::vector<Mixed> args = {Mixed{&box}, Mixed{&circle}, Mixed{&polygon}, Mixed{&invalid},
Expand Down
12 changes: 6 additions & 6 deletions test/test_query_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,21 +290,21 @@ TEST(Geospatial_PolygonValidation)
GeoPoint{55.6280, 12.0826}};
TableRef table = setup_with_points(g, points);
ColKey location_column_key = table->get_column_key("location");
Geospatial geo_poly{GeoPolygon{{{GeoPoint{40.7128, -74.006}, GeoPoint{55.6761, 12.5683}, GeoPoint{55.628, 12.0826},
GeoPoint{40.7128, -74.006}}}}};
Geospatial geo_poly{GeoPolygon{{{GeoPoint{40.7128, -74.006}, GeoPoint{55.6761, 12.5683},
GeoPoint{55.628, 12.0826}, GeoPoint{40.7128, -74.006}}}}};
CHECK(geo_poly.is_valid().is_ok());
Query query = table->column<Link>(location_column_key).geo_within(geo_poly);
CHECK_EQUAL(query.count(), 1);

// same as above because the normalized polygon inverts when covering more than a hemisphere
Geospatial geo_poly_reversed{GeoPolygon{{{GeoPoint{40.7128, -74.006}, GeoPoint{55.628, 12.0826},
GeoPoint{55.6761, 12.5683}, GeoPoint{40.7128, -74.006}}}}};
GeoPoint{55.6761, 12.5683}, GeoPoint{40.7128, -74.006}}}}};
CHECK(geo_poly_reversed.is_valid().is_ok());
query = table->column<Link>(location_column_key).geo_within(geo_poly_reversed);
CHECK_EQUAL(query.count(), 1);

Geospatial poly_mismatch_loop{GeoPolygon{{{GeoPoint{40.7128, -74.006}, GeoPoint{55.6761, 12.5683},
GeoPoint{55.628, 12.0826}, GeoPoint{40.7128, -74.000}}}}};
GeoPoint{55.628, 12.0826}, GeoPoint{40.7128, -74.000}}}}};
Status status = poly_mismatch_loop.is_valid();
CHECK(!status.is_ok());
CHECK_EQUAL(status.reason(), "Ring is not closed, first vertex 'GeoPoint([40.7128, -74.006])' does not equal "
Expand Down Expand Up @@ -351,8 +351,8 @@ TEST(Geospatial_PolygonValidation)
CHECK(!status.is_ok());
CHECK_EQUAL(status.reason(), "Polygon has no rings.");

Geospatial poly_duplicates{
GeoPolygon{{{GeoPoint{0, 0}, GeoPoint{0, 1}, GeoPoint{0, 1}, GeoPoint{0, 1}, GeoPoint{1, 1}, GeoPoint{0, 0}}}}};
Geospatial poly_duplicates{GeoPolygon{
{{GeoPoint{0, 0}, GeoPoint{0, 1}, GeoPoint{0, 1}, GeoPoint{0, 1}, GeoPoint{1, 1}, GeoPoint{0, 0}}}}};
status = poly_duplicates.is_valid();
CHECK(status.is_ok()); // adjacent duplicates are removed

Expand Down

0 comments on commit 8d63d3c

Please sign in to comment.