diff --git a/include/core/utils/params_server.hpp b/include/core/utils/params_server.hpp index 94e8f1a8468a89749685ad471ee9b234e392f84d..c8d74c4df793b8f16696a5674150af505651e7bd 100644 --- a/include/core/utils/params_server.hpp +++ b/include/core/utils/params_server.hpp @@ -68,14 +68,14 @@ public: _params.insert(std::pair<std::string, std::string>(key, value)); } - template<typename T> - T getParam(std::string key, std::string def_value) const { - if(_params.find(key) != _params.end()){ - return converter<T>::convert(_params.find(key)->second); - }else{ - return converter<T>::convert(def_value); - } - } +// template<typename T> +// T getParam(std::string key, std::string def_value) const { +// if(_params.find(key) != _params.end()){ +// return converter<T>::convert(_params.find(key)->second); +// }else{ +// return converter<T>::convert(def_value); +// } +// } template<typename T> T getParam(std::string key) const { diff --git a/test/gtest_param_server.cpp b/test/gtest_param_server.cpp index 00c6c099f6542e6e1f08dc9e2e451d8d2d055e81..bfa888fa7fc415c1689eb6b66a30b2919b599dbd 100644 --- a/test/gtest_param_server.cpp +++ b/test/gtest_param_server.cpp @@ -16,18 +16,19 @@ ParserYAML parse(string _file, string _path_root) return parser; } -TEST(ParamsServer, Default) -{ - auto parser = parse("test/yaml/params1.yaml", wolf_root); - auto params = parser.getParams(); - ParamsServer server = ParamsServer(params, parser.sensorsSerialization(), parser.processorsSerialization()); - EXPECT_EQ(server.getParam<double>("should_not_exist", "2.6"), 2.6); - EXPECT_EQ(server.getParam<bool>("my_proc_test/voting_active", "true"), false); - EXPECT_NE(server.getParam<unsigned int>("my_proc_test/time_tolerance", "23"), 23); - EXPECT_THROW({ server.getParam<unsigned int>("test error"); }, std::runtime_error); - EXPECT_NE(server.getParam<unsigned int>("my_proc_test/time_tolerance"), 23); - EXPECT_EQ(server.getParam<bool>("my_proc_test/voting_active"), false); -} +//TEST(ParamsServer, Default) +//{ +// auto parser = parse("test/yaml/params1.yaml", wolf_root); +// auto params = parser.getParams(); +// ParamsServer server = ParamsServer(params, parser.sensorsSerialization(), parser.processorsSerialization()); +// EXPECT_EQ(server.getParam<double>("should_not_exist", "2.6"), 2.6); +// EXPECT_EQ(server.getParam<bool>("my_proc_test/voting_active", "true"), false); +// EXPECT_NE(server.getParam<unsigned int>("my_proc_test/time_tolerance", "23"), 23); +// EXPECT_THROW({ server.getParam<unsigned int>("test error"); }, std::runtime_error); +// EXPECT_NE(server.getParam<unsigned int>("my_proc_test/time_tolerance"), 23); +// EXPECT_EQ(server.getParam<bool>("my_proc_test/voting_active"), false); +//} + int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv);