| 2355 | } |
| 2356 | |
| 2357 | void CheckGeoStatistics(std::shared_ptr<const LogicalType> type, |
| 2358 | std::shared_ptr<geospatial::GeoStatistics> geom_stats, |
| 2359 | int64_t start_index, int64_t num_rows) { |
| 2360 | // We don't yet generate statistics for Geography |
| 2361 | if (type->is_geography()) { |
| 2362 | ASSERT_EQ(geom_stats, nullptr); |
| 2363 | return; |
| 2364 | } |
| 2365 | |
| 2366 | ASSERT_NE(geom_stats, nullptr); |
| 2367 | // We wrote exactly one geometry type (POINT, which has code 1) |
| 2368 | EXPECT_THAT(*geom_stats->geometry_types(), ::testing::ElementsAre(1)); |
| 2369 | |
| 2370 | double expected_xmin = static_cast<double>(start_index); |
| 2371 | double expected_xmax = expected_xmin + num_rows - 1; |
| 2372 | double expected_ymin = expected_xmin + 1; |
| 2373 | double expected_ymax = expected_xmax + 1; |
| 2374 | |
| 2375 | EXPECT_EQ(geom_stats->lower_bound()[0], expected_xmin); |
| 2376 | EXPECT_EQ(geom_stats->upper_bound()[0], expected_xmax); |
| 2377 | EXPECT_EQ(geom_stats->lower_bound()[1], expected_ymin); |
| 2378 | EXPECT_EQ(geom_stats->upper_bound()[1], expected_ymax); |
| 2379 | EXPECT_THAT(geom_stats->dimension_valid(), |
| 2380 | ::testing::ElementsAre(true, true, false, false)); |
| 2381 | } |
| 2382 | |
| 2383 | protected: |
| 2384 | std::shared_ptr<Buffer> file_buf; |
nothing calls this directly
no test coverage detected