Skip to content

Commit

Permalink
Add in tests for new, more restrictive parsing.
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Apr 16, 2018
1 parent 76856b7 commit 7c32246
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions urdf_parser/test/urdf_unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,24 @@ TEST(URDF_UNIT_TEST, parse_link_doubles)
EXPECT_EQ(0.0012, urdf->links_["l1"]->inertial->iyz);
EXPECT_EQ(0.908, urdf->links_["l1"]->inertial->izz);
}

TEST(URDF_UNIT_TEST, material_no_name)
{
std::string joint_str =
"<robot name=\"test\">"
" <material/>"
" <link name=\"l1\"/>"
"</robot>";
urdf::ModelInterfaceSharedPtr urdf = urdf::parseURDF(joint_str);
ASSERT_EQ(nullptr, urdf);
}

TEST(URDF_UNIT_TEST, link_no_name)
{
std::string joint_str =
"<robot name=\"test\">"
" <link/>"
"</robot>";
urdf::ModelInterfaceSharedPtr urdf = urdf::parseURDF(joint_str);
ASSERT_EQ(nullptr, urdf);
}

0 comments on commit 7c32246

Please sign in to comment.