test_defaultsAtLaunch.cpp
Go to the documentation of this file.
00001 #include <gtest/gtest.h>
00002 #include <ros/ros.h>
00003 #include <rosparam_handler/DefaultsAtLaunchParameters.h>
00004 
00005 typedef rosparam_handler::DefaultsAtLaunchParameters ParamType;
00006 typedef rosparam_handler::DefaultsAtLaunchConfig ConfigType;
00007 
00008 TEST(RosparamHandler, DefaultsAtLaunch) {
00009     ParamType testParams(ros::NodeHandle("~"));
00010     ASSERT_NO_THROW(testParams.fromParamServer());
00011 
00012     ASSERT_EQ(1, testParams.int_param_wo_default);
00013     ASSERT_DOUBLE_EQ(1.1, testParams.double_param_wo_default);
00014     ASSERT_EQ("Hello World", testParams.str_param_wo_default);
00015     ASSERT_EQ(true, testParams.bool_param_wo_default);
00016 
00017     ASSERT_EQ(std::vector<int>({1, 2, 3}), testParams.vector_int_param_wo_default);
00018     ASSERT_EQ(std::vector<double>({1.1, 1.2, 1.3}), testParams.vector_double_param_wo_default);
00019     ASSERT_EQ(std::vector<bool>({false, true}), testParams.vector_bool_param_wo_default);
00020     ASSERT_EQ(std::vector<std::string>({"Hello", "World"}), testParams.vector_string_param_wo_default);
00021 
00022     std::map<std::string, std::string> tmp{{"Hello", "World"}};
00023     ASSERT_EQ(tmp, testParams.map_param_wo_default);
00024 
00025     ASSERT_EQ(1, testParams.enum_param_wo_default);
00026 }


rosparam_handler
Author(s): Claudio Bandera
autogenerated on Sat Jun 8 2019 20:21:53