test_rosparam_utils.cpp
Go to the documentation of this file.
2 #include <XmlRpcValue.h>
3 #include <gtest/gtest.h>
4 
5 
6 TEST(RoparamUtils, testGetXmlDoubleValue){
7  // type int
10  EXPECT_EQ(1.0, jsk_topic_tools::getXMLDoubleValue(v));
11  // type double
12  v = 1.0;
14  EXPECT_EQ(1.0, jsk_topic_tools::getXMLDoubleValue(v));
15  // test unparsable param
16  try {
17  v = "-.3";
18  EXPECT_EQ(-0.3, jsk_topic_tools::getXMLDoubleValue(v));
19  } catch (std::runtime_error &e) {
20  SUCCEED() << "Not parsable value";
21  return;
22  }
23 }
24 
25 int main(int argc, char **argv){
26  testing::InitGoogleTest(&argc, argv);
27  return RUN_ALL_TESTS();
28 }
TEST(RoparamUtils, testGetXmlDoubleValue)
Type const & getType() const
double getXMLDoubleValue(XmlRpc::XmlRpcValue val)
int SUCCEED
int main(int argc, char **argv)


jsk_topic_tools
Author(s): Kei Okada , Yusuke Furuta
autogenerated on Tue Feb 6 2018 03:45:19