Commit adca6191 authored by Victor Lamoine's avatar Victor Lamoine

Small improvements

parent a71ede61
Pipeline #8325684 passed with stages
in 5 minutes and 9 seconds
cmake_minimum_required(VERSION 3.5.0)
cmake_minimum_required(VERSION 2.8)
project(simple_rostest)
add_compile_options(-std=c++11 -Wall -Wextra)
......@@ -29,9 +29,6 @@ generate_messages(
###################################
catkin_package(
# INCLUDE_DIRS
# include
# LIBRARIES
CATKIN_DEPENDS
std_msgs
)
......
......@@ -3,15 +3,14 @@
<name>simple_rostest</name>
<version>0.0.0</version>
<description>An example package for ROS automated tests</description>
<maintainer email="victor.lamoine@gmail.com">Victor Lamoine</maintainer>
<license>BSD</license>
<buildtool_depend>catkin</buildtool_depend>
<depend>genmsg</depend>
<depend>roscpp</depend>
<depend>rostest</depend>
<depend>std_msgs</depend>
<depend>roscpp</depend>
</package>
......@@ -11,15 +11,17 @@ bool AddTwoInts(simple_rostest::AddTwoIntsRequest &req,
int main(int argc,
char** argv)
{
ros::init(argc, argv, "urdf_joints_tree");
ros::init(argc, argv, "add_two_ints_srv");
ros::NodeHandle nh;
ros::AsyncSpinner spinner(1);
spinner.start();
// Advertise service
ros::ServiceServer service = nh.advertiseService("add_two_ints", AddTwoInts);
ros::AsyncSpinner spinner(1);
spinner.start();
ros::waitForShutdown();
spinner.stop();
return 0;
}
......@@ -12,13 +12,12 @@ TEST(TESTSuite, addTwoInts)
bool exists(client.waitForExistence(ros::Duration(1)));
EXPECT_TRUE(exists);
simple_rostest::AddTwoInts srv;
srv.request.a = 5;
srv.request.b = 8;
client.call(srv);
EXPECT_EQ(srv.response.sum, 5+8);
EXPECT_EQ(srv.response.sum, srv.request.a + srv.request.b);
}
int main(int argc,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment