| 2079 | } |
| 2080 | |
| 2081 | void CheckGeoStatistics(std::shared_ptr<const LogicalType> type, |
| 2082 | std::shared_ptr<geospatial::GeoStatistics> geom_stats, |
| 2083 | int64_t start_index, int64_t num_rows) { |
| 2084 | // We don't yet generate statistics for Geography |
| 2085 | if (type->is_geography()) { |
| 2086 | ASSERT_EQ(geom_stats, nullptr); |
| 2087 | return; |
| 2088 | } |
| 2089 | |
| 2090 | ASSERT_NE(geom_stats, nullptr); |
| 2091 | // We wrote exactly one geometry type (POINT, which has code 1) |
| 2092 | EXPECT_THAT(*geom_stats->geometry_types(), ::testing::ElementsAre(1)); |
| 2093 | |
| 2094 | double expected_xmin = static_cast<double>(start_index); |
| 2095 | double expected_xmax = expected_xmin + num_rows - 1; |
| 2096 | double expected_ymin = expected_xmin + 1; |
| 2097 | double expected_ymax = expected_xmax + 1; |
| 2098 | |
| 2099 | EXPECT_EQ(geom_stats->lower_bound()[0], expected_xmin); |
| 2100 | EXPECT_EQ(geom_stats->upper_bound()[0], expected_xmax); |
| 2101 | EXPECT_EQ(geom_stats->lower_bound()[1], expected_ymin); |
| 2102 | EXPECT_EQ(geom_stats->upper_bound()[1], expected_ymax); |
| 2103 | EXPECT_THAT(geom_stats->dimension_valid(), |
| 2104 | ::testing::ElementsAre(true, true, false, false)); |
| 2105 | } |
| 2106 | |
| 2107 | protected: |
| 2108 | std::shared_ptr<Buffer> file_buf; |
nothing calls this directly
no test coverage detected