1 #include <gtest/gtest.h> 3 #include <dynamic_reconfigure/server.h> 5 #include <rosparam_handler/DefaultsParameters.h> 7 typedef rosparam_handler::DefaultsParameters
ParamType;
20 drSrv.setCallback(cb);
39 dynamic_reconfigure::Server<ConfigType>
drSrv;
53 ASSERT_DOUBLE_EQ(1.1,
testParams.double_param_w_default);
54 ASSERT_EQ(
"Hello World",
testParams.str_param_w_default);
67 dynamic_reconfigure::ReconfigureRequest srv_req;
68 dynamic_reconfigure::ReconfigureResponse srv_resp;
69 dynamic_reconfigure::Config conf;
71 dynamic_reconfigure::IntParameter int_param;
72 int_param.name =
"int_param_w_default";
75 dynamic_reconfigure::DoubleParameter double_param;
76 double_param.name =
"double_param_w_default";
77 double_param.value = 2.2;
79 dynamic_reconfigure::StrParameter str_param;
80 str_param.name =
"str_param_w_default";
81 str_param.value =
"Foo Bar";
83 dynamic_reconfigure::BoolParameter bool_param;
84 bool_param.name =
"bool_param_w_default";
85 bool_param.value =
false;
87 conf.ints.push_back(int_param);
88 conf.doubles.push_back(double_param);
89 conf.strs.push_back(str_param);
90 conf.bools.push_back(bool_param);
92 srv_req.config = conf;
99 EXPECT_DOUBLE_EQ(2.2,
testParams.double_param_w_default);
100 EXPECT_EQ(
"Foo Bar",
testParams.str_param_w_default);
101 EXPECT_FALSE(
testParams.bool_param_w_default);
110 EXPECT_EQ(
testParams.int_param_w_default, config.int_param_w_default);
111 EXPECT_DOUBLE_EQ(
testParams.double_param_w_default, config.double_param_w_default);
112 EXPECT_EQ(
testParams.str_param_w_default, config.str_param_w_default);
113 EXPECT_FALSE(config.bool_param_w_default);
bool deleteParam(const std::string &key) const
bool call(const std::string &service_name, MReq &req, MRes &res)
rosparam_handler::DefaultsConfig ConfigType
const std::string & getNamespace() const
rosparam_handler::DefaultsParameters ParamType