Skip to content

Cover cases in polygonToCells which fail after estimation#1196

Open
isaacbrodsky wants to merge 2 commits into
uber:masterfrom
isaacbrodsky:polygon-to-cells-nan
Open

Cover cases in polygonToCells which fail after estimation#1196
isaacbrodsky wants to merge 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.

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