Skip to content

Commit

Permalink
add an explicit float check
Browse files Browse the repository at this point in the history
There is currently no explicit test for correct float parsing for eg `xyz` vectors
  • Loading branch information
simonschmeisser authored and scpeters committed Jan 13, 2020
1 parent e067427 commit 5dfdaf1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions urdf_parser/test/urdf_unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ TEST(URDF_UNIT_TEST, test_vector3_simple)
EXPECT_EQ(3.0, vec.z);
}

TEST(URDF_UNIT_TEST, test_vector3_float)
{
urdf::Vector3 vec;

vec.init("0.1 0.2 0.3");

EXPECT_EQ(0.1, vec.x);
EXPECT_EQ(0.2, vec.y);
EXPECT_EQ(0.3, vec.z);
}

TEST(URDF_UNIT_TEST, test_vector3_bad_string)
{
urdf::Vector3 vec;
Expand Down

0 comments on commit 5dfdaf1

Please sign in to comment.