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 22e332a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/parser_urdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ 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)
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 22e332a

Please sign in to comment.