Go to the documentation of this file.
29 #include <gtest/gtest.h>
33 #include <swri_roscpp/TestTopicServiceRequest.h>
34 #include <swri_roscpp/TestTopicServiceResponse.h>
57 static const std::string
topic_name =
"/test_topic_service";
77 ROS_INFO(
"TopicServiceHandler::handleTopicServiceRequest");
78 resp.response_value = req.request_value;
102 TEST(TopicServiceClientTests, testTopicServiceClient)
112 while (!client.
exists() && checks < 20)
114 ROS_INFO(
"Waiting for server to exist...");
118 ASSERT_TRUE(client.
exists());
126 bool result = client.
call(srv);
135 ASSERT_FALSE(result);
141 TEST(TopicServiceServerTests, testTopicServiceServer)
162 ASSERT_FALSE(handler.
error_);
170 int main(
int argc,
char** argv)
176 testing::InitGoogleTest(&argc, argv);
177 retval = RUN_ALL_TESTS();
bool handleTopicServiceRequest(const swri_roscpp::TestTopicService::Request &req, swri_roscpp::TestTopicService::Response &resp)
ROSCPP_DECL void init(const M_string &remappings, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
ROSCPP_DECL void spinOnce()
void initialize(ros::NodeHandle &nh, const std::string &service, bool(T::*srv_func)(const MReq &, MRes &), T *obj)
ROSCPP_DECL void shutdown()
TestTopicServiceResponse Response
static const int test_values[]
static const size_t value_count
TEST(TopicServiceClientTests, testTopicServiceClient)
TestTopicServiceRequest Request
static const std::string topic_name
void initialize(ros::NodeHandle &nh, const std::string &service, const std::string &client_name="")
swri_roscpp
Author(s): P. J. Reed
autogenerated on Fri Aug 2 2024 08:39:15