eds: fix LowLimit/HighLimit parsing for all signed integer types#658
Open
friederschueler wants to merge 1 commit intocanopen-python:masterfrom
Open
eds: fix LowLimit/HighLimit parsing for all signed integer types#658friederschueler wants to merge 1 commit intocanopen-python:masterfrom
friederschueler wants to merge 1 commit intocanopen-python:masterfrom
Conversation
- Replace incomplete _calc_bit_length() (only handled 4 of 8 signed types) with a lookup dict covering all SIGNED_TYPES (INTEGER8/16/24/32/40/48/56/64) - Log a warning instead of silently ignoring invalid limit values - Add EDS test entries for INTEGER24/40/48/56 with hex-encoded negative limits - Extend test_record_with_limits and add test_invalid_limit_logs_warning Note: eds.py and test_eds.py were formatted with black. The formatting changes can be dropped if a pure functional change is preferred.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Fixes incomplete signed integer handling for
LowLimit/HighLimitin EDS parsing, as noted in #352.Changes
_calc_bit_length()(only handled INTEGER8/16/32/64) with a lookup dict_SIGNED_BIT_LENGTHScovering all 8SIGNED_TYPES(INTEGER8/16/24/32/40/48/56/64)warninginstead of silently ignoring invalid limit values (except ValueError: pass)sample.edsfor INTEGER24/40/48/56 with hex-encoded negative limitstest_record_with_limitsand addtest_invalid_limit_logs_warningNote on formatting
eds.pyandtest_eds.pywere reformatted with black. If a purely functional diff is preferred, the formatting commits can be dropped — the functional changes are small and easy to separate.Closes part of #352.