Closed scpeters closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.44%. Comparing base (
ff9b3ad
) to head (e55a9e1
). Report is 13 commits behind head on sdf14.:exclamation: Current head e55a9e1 differs from pull request most recent head 39036ee
Please upload reports for the commit 39036ee to get more accurate results.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
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.
ok, thanks for bringing that up. I updated ElementPrivate::PrintAttributes
in https://github.com/gazebosim/sdformat/pull/1407/commits/a4f811f7fae269b77a8c35f16324340ce5f1f214 to always print custom attributes
Empty attributes in the <plugin/>
element won't be printed by ToString
unless they are in a custom xml namespace, as I've noticed with the following test patch:
diff --git a/test/integration/plugin_attribute.cc b/test/integration/plugin_attribute.cc
index 7f4f9f4c..b66c9da1 100644
--- a/test/integration/plugin_attribute.cc
+++ b/test/integration/plugin_attribute.cc
@@ -65,4 +65,9 @@ TEST(PluginAttribute, ParseAttributes)
EXPECT_EQ(value->Get<std::string>(""),
std::string("value"));
}
+ {
+ auto pluginToString = plugin->ToString("");
+ EXPECT_NE(std::string::npos, pluginToString.find("empty_attribute=''"))
+ << pluginToString;
+ }
}
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
LGTM! Opening an issue to document the behavior in
<plugin>
sounds good.
opened a new issue: https://github.com/gazebosim/sdformat/issues/1421
🦟 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 https://github.com/gazebosim/sdformat/commit/0637c210053ae3d1b98e9be55b30f9b3f1e3516f to confirm the bug and fixes the errors in https://github.com/gazebosim/sdformat/commit/e55a9e1a251b650ac0588e0e2b7323f0ca900961 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.