Skip to content

Commit

Permalink
fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aagrawal05 committed Apr 5, 2024
1 parent ceed898 commit e538eb2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/parser_urdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2108,14 +2108,14 @@ void InsertSDFExtensionVisual(tinyxml2::XMLElement *_elem,
void InsertSDFExtensionLink(tinyxml2::XMLElement *_elem,
const std::string &_linkName)
{
bool link_found = false;
bool link_found = false;
for (StringSDFExtensionPtrMap::iterator
sdfIt = g_extensions.begin();
sdfIt != g_extensions.end(); ++sdfIt)
{
if (sdfIt->first == _linkName)
{
link_found = true;
link_found = true;
sdfdbg << "inserting extension with reference ["
<< _linkName << "] into link.\n";
for (std::vector<SDFExtensionPtr>::iterator ge =
Expand Down Expand Up @@ -2159,8 +2159,8 @@ void InsertSDFExtensionLink(tinyxml2::XMLElement *_elem,
// If we didn't find the link, emit a warning
if (!link_found) {
sdfwarn << "<gazebo> tag with reference[" << _linkName << "] does not exist in the URDF model. Please "
<< "ensure that the referenced attribute matches the name of a link, consider checking unicode "
<< "representation for reference attribute in case of invisible characters and homoglyphs";
<< "ensure that the referenced attribute matches the name of a link, consider checking unicode "
<< "representation for reference attribute in case of invisible characters and homoglyphs";
}
}

Expand Down
30 changes: 15 additions & 15 deletions src/parser_urdf_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2463,7 +2463,7 @@ TEST(URDFParser, ZeroMassLeafLink)
/////////////////////////////////////////////////
TEST(URDFParser, ParseGazeboRefDoesntExistWarningMessage)
{
// Redirect sdfwarn output
// Redirect sdfwarn output
std::stringstream buffer;
sdf::testing::RedirectConsoleStream redir(
sdf::Console::Instance()->GetMsgStream(), &buffer);
Expand All @@ -2476,9 +2476,9 @@ TEST(URDFParser, ParseGazeboRefDoesntExistWarningMessage)
});
#endif

// test if reference to link exists
{
// clear the contents of the buffer
// test if reference to link exists
{
// clear the contents of the buffer
buffer.str("");

std::string str = R"(
Expand All @@ -2505,17 +2505,17 @@ TEST(URDFParser, ParseGazeboRefDoesntExistWarningMessage)
sdf::ParserConfig config;
parser.InitModelString(str, config, &sdfResult);

EXPECT_PRED2(sdf::testing::contains, buffer.str(),
"<gazebo> tag with reference[link1] does not exist in the URDF model. Please "
"ensure that the referenced attribute matches the name of a link, consider checking unicode "
"representation for reference attribute in case of invisible characters and homoglyphs");
}

// TODO: Similar tests for -
// InsertSDFExtensionCollision,
// InsertSDFExtensionRobot,
// InsertSDFExtensionVisual,
// InsertSDFExtensionJoint
EXPECT_PRED2(sdf::testing::contains, buffer.str(),
"<gazebo> tag with reference[link1] does not exist in the URDF model. Please "
"ensure that the referenced attribute matches the name of a link, consider checking unicode "
"representation for reference attribute in case of invisible characters and homoglyphs");
}

// TODO: Similar tests for -
// InsertSDFExtensionCollision,
// InsertSDFExtensionRobot,
// InsertSDFExtensionVisual,
// InsertSDFExtensionJoint
}

/////////////////////////////////////////////////
Expand Down

0 comments on commit e538eb2

Please sign in to comment.