Add error return codes to h3Index.c (part 1)#503
Merged
isaacbrodsky merged 5 commits intouber:masterfrom Aug 11, 2021
Merged
Conversation
dfellis
reviewed
Aug 11, 2021
| // a pentagon always intersects 5 faces, a hexagon never intersects more | ||
| // than 2 (but may only intersect 1) | ||
| return H3_EXPORT(isPentagon)(h3) ? 5 : 2; | ||
| *out = H3_EXPORT(isPentagon)(h3) ? 5 : 2; |
Collaborator
There was a problem hiding this comment.
Presumably later on this will also return an error message if the int64 isn't an H3 index?
Collaborator
Author
There was a problem hiding this comment.
We could choose to add that check when being called by an application, yes. (Internally we might want to do that check once and then bypass it)
dfellis
approved these changes
Aug 11, 2021
nrabinowitz
approved these changes
Aug 11, 2021
| t_assert(numChildrenError == expectedError, "Expected error code"); | ||
| if (expectedError != E_SUCCESS) { | ||
| return; | ||
| } |
Collaborator
There was a problem hiding this comment.
Does this imply that there are no errors we can test that won't be returned by cellToChildrenSize? I.e. there are no errors in cellToChildren that aren't in cellToChildrenSize?
Collaborator
Author
There was a problem hiding this comment.
cellToChildren always returns E_SUCCESS right now, so that is correct. It assumes its input has been validated by the size call.
Co-authored-by: Nick Rabinowitz <public@nickrabinowitz.com>
Co-authored-by: Nick Rabinowitz <public@nickrabinowitz.com>
Co-authored-by: Nick Rabinowitz <public@nickrabinowitz.com>
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.
Applies the error return codes RFC to h3Index.c with the exception of some commonly used functions that return true/false.