31 #include <gtest/gtest.h> 36 TEST(RemappingTest, remapping_test)
38 EXPECT_TRUE(
argc_ >= 3);
40 std::string expected_base_ns =
argv_[1];
41 std::string expected_sub_ns =
argv_[2];
46 bool use_local_remap =
false;
47 EXPECT_TRUE(nh.
getParam(
"use_local_remap", use_local_remap))
48 <<
"Param [~use_local_remap] must be defined\n";
52 std::string remap_from, remap_to;
53 EXPECT_TRUE(nh.
getParam(
"remap_from", remap_from)) <<
"Param [~remap_from] must be defined\n";
54 EXPECT_TRUE(nh.
getParam(
"remap_to", remap_to)) <<
"Param [~remap_to] must be defined\n";
58 local_remappings.insert(std::make_pair(remap_from, remap_to));
62 <<
"Error: \"" << base_nh.
getNamespace() <<
"\" != \"" << expected_base_ns <<
"\"\n";
66 <<
"Error: \"" << sub_nh.
getNamespace() <<
"\" != \"" << expected_sub_ns <<
"\"\n";
70 std::cout <<
"***********************************************************************\n";
75 EXPECT_EQ(sub_nh.getNamespace(), expected_sub_ns);
79 int main(
int argc,
char** argv)
81 testing::InitGoogleTest(&argc, argv);
82 ros::init(argc, argv,
"remapping_tester");
85 return RUN_ALL_TESTS();
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
std::map< std::string, std::string > M_string
int main(int argc, char **argv)
const std::string & getNamespace() const
bool getParam(const std::string &key, std::string &s) const
TEST(RemappingTest, remapping_test)