Skip to content

Add unit tests for non-contiguous polygonToCells edge cases (#600)#1128

Open
FurqanShafiq11 wants to merge 1 commit intouber:masterfrom
FurqanShafiq11:tests/issue-600-polyfill-edge-cases
Open

Add unit tests for non-contiguous polygonToCells edge cases (#600)#1128
FurqanShafiq11 wants to merge 1 commit intouber:masterfrom
FurqanShafiq11:tests/issue-600-polyfill-edge-cases

Conversation

@FurqanShafiq11
Copy link

@FurqanShafiq11 FurqanShafiq11 commented Feb 16, 2026

Description

This PR addresses #600 by adding comprehensive unit tests for polygonToCells edge cases.

As discussed in #599, the library lacked tests for non-contiguous cell cases where the "outline-tracing" logic is required. These tests ensure that polygons with disjointed hexagonal regions (where the bridge between regions is too narrow to contain a hexagon center) are correctly processed.

Changes

  • Added 4 test cases to src/apps/testapps/testPolygonToCells.c:
    • Barbell: Two lobes connected by a bridge thinner than a hexagon.
    • Splitting Hole: An interior hole that divides the polygon into two isolated hexagonal clusters.
    • Multi-Island Serpent: A winding polygon that results in 3+ disconnected cell clusters.
    • Transmeridian Barbell: A barbell shape that crosses the 180/-180 degree meridian.
  • Updated CHANGELOG.md under the [Unreleased] section.

Verification

  • Ran ./bin/testPolygonToCells locally.
  • Assertion count increased by 12 (Current total: 120,824).
  • Formatted code using clang-format (version 14).

Closes #600

@CLAassistant
Copy link

CLAassistant commented Feb 16, 2026

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented Feb 16, 2026

Coverage Status

coverage: 99.013%. remained the same
when pulling 65ee789 on FurqanShafiq11:tests/issue-600-polyfill-edge-cases
into 8085979 on uber:master.

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.

Add unit tests for polyfill edge cases

4 participants