Skip to content

Cover cases in polygonToCells which fail after estimation#1196

Merged
isaacbrodsky merged 2 commits into
uber:masterfrom
isaacbrodsky:polygon-to-cells-nan
Jul 24, 2026
Merged

Cover cases in polygonToCells which fail after estimation#1196
isaacbrodsky merged 2 commits into
uber:masterfrom
isaacbrodsky:polygon-to-cells-nan

Conversation

@isaacbrodsky

@isaacbrodsky isaacbrodsky commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator
  • These cases are reachable if polygonToCells result size estimation runs but we cannot evaluate the polygons. This happens if the polygon is partially invalid, previously we only tested if all of the vertices were invalid which does not reach this.
  • Also, cleanup a few leftover comments resolved by Cover failure cases in gridDisk, gridRing, etc #1195

@coveralls

coveralls commented Jul 24, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 99.662% (+0.2%) from 99.475% — isaacbrodsky:polygon-to-cells-nan into uber:master

Comment thread src/apps/testapps/testPolygonToCells.c Outdated
Comment on lines +516 to +529
TEST(polygonToCells) {
int64_t numHexagons;
t_assertSuccess(H3_EXPORT(maxPolygonToCellsSize)(&invalidSfGeoPolygon,
9, 0, &numHexagons));
H3Index *hexagons = calloc(numHexagons, sizeof(H3Index));

t_assert(H3_EXPORT(polygonToCells)(&invalidSfGeoPolygon, 9, 0,
hexagons) == E_FAILED,
"Partially NAN geo polygon cannot be evaluated");

free(hexagons);
}

TEST(polygonToCellsHole) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit on the test names; they're not super descriptive on what is being tested.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that's a mistake. Fixed.

@isaacbrodsky
isaacbrodsky merged commit 43c089d into uber:master Jul 24, 2026
47 checks passed
@isaacbrodsky
isaacbrodsky deleted the polygon-to-cells-nan branch July 24, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants