31 #include <gtest/gtest.h> 36 #define PRINT(cmd) printf(#cmd"\n"); cmd; printf("\n"); 38 TEST(NamespaceRemappingTest, unqualified_remaps)
41 local_remappings.insert(std::make_pair(
"a",
"Ra"));
42 local_remappings.insert(std::make_pair(
"b",
"Rb"));
43 local_remappings.insert(std::make_pair(
"c",
"Rc"));
51 EXPECT_STREQ(base.getNamespace().c_str(),
"/a");
52 EXPECT_STREQ(a1.getNamespace().c_str(),
"/a/Ra");
53 EXPECT_STREQ(a2.getNamespace().c_str(),
"/a/Ra");
54 EXPECT_STREQ( b.getNamespace().c_str(),
"/a/Rb");
55 EXPECT_STREQ( c.getNamespace().c_str(),
"/a/Rc");
58 TEST(NamespaceRemappingTest, qualified_remaps)
61 local_remappings.insert(std::make_pair(
"/a",
"/Ra"));
66 EXPECT_STREQ( a.getNamespace().c_str(),
"/a");
67 EXPECT_STREQ(sub_a.getNamespace().c_str(),
"/a/a");
70 TEST(NamespaceRemappingTest, unqualified_root_remaps)
73 local_remappings.insert(std::make_pair(
"a",
"Ra"));
74 local_remappings.insert(std::make_pair(
"b",
"Rb"));
84 TEST(NamespaceRemappingTest, tilde_namespaces)
87 local_remappings.insert(std::make_pair(
"a",
"Ra"));
88 local_remappings.insert(std::make_pair(
"b",
"Rb"));
99 int main(
int argc,
char** argv)
101 testing::InitGoogleTest(&argc, argv);
102 ros::init(argc, argv,
"remapping_tester");
105 return RUN_ALL_TESTS();
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL const std::string & getName()
std::map< std::string, std::string > M_string
TEST(NamespaceRemappingTest, unqualified_remaps)
const std::string & getNamespace() const