38 #include <gtest/gtest.h> 44 #include <test_roscpp/TestArray.h> 64 if (failure || success)
67 printf(
"received message %d\n", msg->counter);
71 if (msgs_received != msg->counter)
76 if (msgs_received == (msgs_expected - 1))
84 if (msgs_received > msg->counter)
87 printf(
"failed: %d > %d\n", msgs_received, msg->counter);
89 if (msgs_received > (0.01 * msgs_expected))
108 msgs_expected = atoi(
g_argv[2]);
110 if (transport ==
"tcp")
112 else if (transport ==
"udp")
116 ROS_ERROR(
"Unknown transport: %s", transport.c_str());
155 testing::InitGoogleTest(&argc, argv);
159 return RUN_ALL_TESTS();
void MsgCallback(const test_roscpp::TestArray::ConstPtr &msg)
TransportHints & reliable()
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
TEST_F(Subscriptions, pubSubNFast)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
TransportHints & unreliable()
Duration & fromSec(double t)
int main(int argc, char **argv)
test_roscpp::TestEmpty msg
ROSCPP_DECL void spinOnce()