-
Notifications
You must be signed in to change notification settings - Fork 100
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
Allow empty strings in plugin and custom attributes #1407
Conversation
This demonstrates the bug reported in #725. Signed-off-by: Steve Peters <[email protected]>
This allows custom attributes and unrecognized attributes to contain empty strings by setting required == 0 when calling Element::AddAttribute. Fixes #725. Signed-off-by: Steve Peters <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but can you check the output of ToString()
to make sure the custom attribute is included? I seem to recall that was a problem.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## sdf14 #1407 +/- ##
==========================================
+ Coverage 92.42% 92.44% +0.01%
==========================================
Files 134 135 +1
Lines 17751 17837 +86
==========================================
+ Hits 16406 16489 +83
- Misses 1345 1348 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Steve Peters <[email protected]>
ok, thanks for bringing that up. I updated Empty attributes in the
I don't have a good idea for how to fix it, so I'd prefer to open an issue documenting that behavior and potentially close it as won't fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Opening an issue to document the behavior in <plugin>
sounds good.
opened a new issue: #1421 |
Currently errors are generated when adding an attribute containing an empty string to a <plugin> block or as a custom attribute. This adds failing tests to confirm the bug and fixes the errors in by setting `_required == 0` when calling Element::AddAttribute. This also changes Element::ToString to print empty custom attributes. Fixes gazebosim#725. Signed-off-by: Steve Peters <[email protected]>
Currently errors are generated when adding an attribute containing an empty string to a <plugin> block or as a custom attribute. This adds failing tests to confirm the bug and fixes the errors in by setting `_required == 0` when calling Element::AddAttribute. This also changes Element::ToString to print empty custom attributes. Fixes gazebosim#725. Signed-off-by: Steve Peters <[email protected]>
🦟 Bug fix
Fixes #725
Summary
Currently errors are generated when adding an attribute containing an empty string to a
<plugin>
block or as a custom attribute. This adds failing tests in 0637c21 to confirm the bug and fixes the errors in e55a9e1 by setting_required == 0
when calling Element::AddAttribute.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.