35 #include <gtest/gtest.h>
39 #include <test_roscpp/TestArray.h>
40 #include <test_roscpp/TestEmpty.h>
60 void cb_verify(
const test_roscpp::TestArrayConstPtr&)
72 void cb_reset(
const test_roscpp::TestArrayConstPtr&)
81 boost::function<void(
const test_roscpp::TestArrayConstPtr&)> funcs[4] =
102 ROS_INFO(
"unsubscribing %d", cb_num);
120 for (
int i = 0; i < 0x10; i++)
122 for (
int j = 0; j < 4; j++)
123 should_have_it[j] = (i & (1 << j) ?
true :
false);
125 ROS_INFO(
" testing: %d, %d, %d, %d\n",
131 for (
int j = 0; j < 4; j++)
132 if (should_have_it[j]) {
135 ASSERT_TRUE(sub_wrappers());
141 static int count = 0;
142 if (count++ % 10 == 0)
143 ROS_INFO(
"%d/100 tests completed...\n", n_test);
149 for (
int j = 0; j < 4; j++)
150 if (should_have_it[j]) {
151 ASSERT_TRUE(unsub(j));
153 ASSERT_TRUE(unsub_wrappers());
168 TEST(Subscriptions2, multipleDifferentMD5Sums)
184 int main(
int argc,
char** argv)
186 testing::InitGoogleTest(&argc, argv);
187 ros::init(argc, argv,
"multiple_subscriptions");
191 return RUN_ALL_TESTS();