From 5dfdaf186f411b86a041767090e9a16fe2d2a0ea Mon Sep 17 00:00:00 2001 From: Simon Schmeisser Date: Wed, 7 Aug 2019 18:40:11 +0200 Subject: [PATCH] add an explicit float check There is currently no explicit test for correct float parsing for eg `xyz` vectors --- urdf_parser/test/urdf_unit_test.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/urdf_parser/test/urdf_unit_test.cpp b/urdf_parser/test/urdf_unit_test.cpp index c46dd326..eb1c6658 100644 --- a/urdf_parser/test/urdf_unit_test.cpp +++ b/urdf_parser/test/urdf_unit_test.cpp @@ -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;