Go to the documentation of this file.
40 #include <gtest/gtest.h>
62 ASSERT_STREQ(node_name.c_str(),
"/name_remapped");
69 ASSERT_STREQ(
ros::names::clean(
"////asdf///jioweioj/").c_str(),
"/asdf/jioweioj");
72 TEST(RoscppHandles, nodeHandleNameRemapping)
76 remap[
"/a/a"] =
"/a/b";
78 remap[
"d/d"] =
"/c/e";
83 EXPECT_STREQ(n.
resolveName(
"/a/a").c_str(),
"/a/b");
89 EXPECT_STREQ(n2.
resolveName(
"/a/a").c_str(),
"/a/b");
91 EXPECT_STREQ(n2.
resolveName(
"d/d").c_str(),
"/c/e");
92 EXPECT_STREQ(n2.
resolveName(
"d/e").c_str(),
"/z/c/f");
96 main(
int argc,
char** argv)
98 testing::InitGoogleTest(&argc, argv);
99 ros::init( argc, argv,
"name_remapping" );
102 return RUN_ALL_TESTS();
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
ROSCPP_DECL bool get(const std::string &key, bool &b)
TEST(roscpp, parameterRemapping)
ROSCPP_DECL std::string clean(const std::string &name)
ROSCPP_DECL std::string resolve(const std::string &name, bool remap=true)
int main(int argc, char **argv)
std::string resolveName(const std::string &name, bool remap=true) const
ROSCPP_DECL std::string remap(const std::string &name)
const ROSCPP_DECL std::string & getName()
T param(const std::string ¶m_name, const T &default_val)
std::map< std::string, std::string > M_string
test_roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:57