38 #include <gtest/gtest.h> 42 #include <test_roscpp/TestArray.h> 43 #include <test_roscpp/TestStringInt.h> 44 #include <test_roscpp/TestEmpty.h> 51 TEST(Inspection, getAdvertisedTopics)
55 std::vector<std::string> topics;
60 ASSERT_EQ((
int)topics.size(),1);
61 ASSERT_EQ(topics[0],
"/rosout");
72 ASSERT_EQ((
int)topics.size(),4);
76 ASSERT_EQ(topics[0],
"/rosout");
77 ASSERT_EQ(topics[1],
"/topic");
78 ASSERT_EQ(topics[2],
"/ns/topic");
79 ASSERT_EQ(topics[3],
"/global/topic");
86 ASSERT_EQ((
int)topics.size(),1);
87 ASSERT_EQ(topics[0],
"/rosout");
90 TEST(Inspection, commandLineParsing)
95 ASSERT_STREQ(remappings[
"/foo"].c_str(),
"/bar");
96 ASSERT_STREQ(remappings[
"/baz"].c_str(),
"/bang");
97 ASSERT_STREQ(remappings[
"/bomb"].c_str(),
"/barn");
103 testing::InitGoogleTest(&argc, argv);
107 g_argv[0] = strdup(argv[0]);
108 g_argv[1] = strdup(
"foo:=bar");
109 g_argv[2] = strdup(
"bat");
110 g_argv[3] = strdup(
"baz:=bang");
111 g_argv[4] = strdup(
"boom");
112 g_argv[5] = strdup(
"baz=bomb");
113 g_argv[6] = strdup(
"bomb:=barn");
114 g_argv[7] = strdup(
"--bangbang");
119 return RUN_ALL_TESTS();
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL const M_string & getRemappings()
std::map< std::string, std::string > M_string
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
int main(int argc, char **argv)
TEST(Inspection, getAdvertisedTopics)
ROSCPP_DECL void getAdvertisedTopics(V_string &topics)