Protect against overflow/underflow for integer record types#110
Open
AlexanderWells-diamond wants to merge 7 commits intomasterfrom
Open
Protect against overflow/underflow for integer record types#110AlexanderWells-diamond wants to merge 7 commits intomasterfrom
AlexanderWells-diamond wants to merge 7 commits intomasterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #110 +/- ##
==========================================
- Coverage 87.03% 86.90% -0.14%
==========================================
Files 14 14
Lines 972 985 +13
==========================================
+ Hits 846 856 +10
- Misses 126 129 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Collaborator
Author
|
Thinking about it, in its current form this PR does mean you can no longer signal a boolOut/mbbOut record is in an invalid state by setting an out-of-range number to trigger the "ILLEGAL VALUE" error handling in EPICS. That's related to issue #53. I don't know if this is a significant concern. |
Long records restricted to int32 min/max, bool to 0 or 1, mbb to 0-15.
This will cause data validation to occur for caput'd values Also fix tests (previously we were putting invalid values to bool records)
Note we have to skip mbbOut record testing, as for some reason cothread caput succeeds for this record type but not for the others
6d06d27 to
9c19bed
Compare
e946c48 to
54435ca
Compare
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.
Long, Bool and MBB record types are now protected from out of range values -
.set()will throw an exception, andcaput()will fail to store the new value. This means records can no longer be put into invalid values, or suffer from integer overflow/underflow.Also correct an oversight in
get_field_offsets, to properly raise a Python exception when the record type cannot be found.Closes #66