Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover getPentagons res argument being invalid #642

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

isaacbrodsky
Copy link
Collaborator

@isaacbrodsky isaacbrodsky commented Aug 19, 2022

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.

@coveralls
Copy link

coveralls commented Aug 19, 2022

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
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
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
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