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();