Skip to content

Cover getPentagons res argument being invalid#642

Merged
isaacbrodsky merged 1 commit into
uber:masterfrom
isaacbrodsky:get-pentagons-coverage
Aug 24, 2022
Merged

Cover getPentagons res argument being invalid#642
isaacbrodsky merged 1 commit into
uber:masterfrom
isaacbrodsky:get-pentagons-coverage

Conversation

@isaacbrodsky

@isaacbrodsky isaacbrodsky commented Aug 19, 2022

Copy link
Copy Markdown
Collaborator

Mainly-test only change to cover an additional line. The core library change is adding a coverage exclusion comment on a line we already excluded the branch coverage for. I plan to merge after v4.0.0.

@isaacbrodsky isaacbrodsky force-pushed the get-pentagons-coverage branch from 5b5fdf1 to 7218c73 Compare August 19, 2022 01:20
@coveralls

coveralls commented Aug 19, 2022

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.06%) to 98.975% when pulling 7218c73 on isaacbrodsky:get-pentagons-coverage into 46a581c on uber:master.

H3Index h3Indexes[PADDED_COUNT] = {0};
t_assert(H3_EXPORT(getPentagons)(16, h3Indexes) == E_RES_DOMAIN,
"getPentagons of invalid resolutions fails");
t_assert(H3_EXPORT(getPentagons)(100, h3Indexes) == E_RES_DOMAIN,

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.

For my info, is there any difference between this test and the one above? Having two tests implies two cases, but I think there's only one here.

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.

They should be the same code path, just different order of magnitude of the resolution parameter.

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.

Well, we do bit-packing in this library and many values are constrained well below an integer, so I can see a difference between a 5-bit value (the 16) and a 7-bit value (the 100) for our testing. If we simply lopped off the high bits they'd be turned into res 0 and res 4, respectively.

@isaacbrodsky isaacbrodsky marked this pull request as ready for review August 23, 2022 16:34
@isaacbrodsky isaacbrodsky merged commit 0a0253c into uber:master Aug 24, 2022
@isaacbrodsky isaacbrodsky deleted the get-pentagons-coverage branch August 24, 2022 16:18
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