Cover getPentagons res argument being invalid#642
Merged
Conversation
5b5fdf1 to
7218c73
Compare
dfellis
approved these changes
Aug 19, 2022
nrabinowitz
approved these changes
Aug 22, 2022
| 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, |
Collaborator
There was a problem hiding this comment.
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.
Collaborator
Author
There was a problem hiding this comment.
They should be the same code path, just different order of magnitude of the resolution parameter.
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.