1 #include <boost/interprocess/shared_memory_object.hpp>
3 #include <gtest/gtest.h>
8 #include <ros/duration.h>
10 #include <ros/names.h>
15 namespace ipc = boost::interprocess;
23 ros::Time end_init = ros::Time::now() + ros::Duration(2);
25 while(ros::Time::now() < end_init)
29 ros::Duration(0.5).sleep();
45 double last_time_stamp = 0;
46 EXPECT_FALSE(ros::isShuttingDown());
47 ros::Time start = ros::Time::now();
48 ros::Time shm_kill_time = start + ros::Duration(5);
49 bool shm_killed =
false;
50 ros::Time end = start + ros::Duration(20);
53 while(ros::Time::now() < end)
55 if (!shm_killed && ros::Time::now() >= shm_kill_time)
57 ipc::shared_memory_object::remove(test_server_name_shm.c_str());
59 ros::Duration(1.5).sleep();
66 EXPECT_TRUE(client.nextImage(image)) <<
"i=" << i;
72 EXPECT_FALSE(ros::isShuttingDown());
76 int main(
int argc,
char **argv)
78 ros::init(argc, argv,
"connection_client");
79 testing::InitGoogleTest(&argc, argv);
80 return RUN_ALL_TESTS();