8 #include <gtest/gtest.h> 13 #include "udp_com/UdpPacket.h" 14 #include "udp_com/UdpSend.h" 15 #include "udp_com/UdpSocket.h" 22 std::vector<uint8_t> packet(length, initialValue);
32 TEST(UdpTestSuite, doesCreateSocketServiceExist)
44 TEST(UdpTestSuite, doesSendServiceExist)
56 TEST(UdpTestSuite, testCreateSocketService)
63 nh.
serviceClient<udp_com::UdpSocket>(
"/eno1/udp/create_socket");
64 udp_com::UdpSocket socket_request;
68 socket_request.request.srcAddress =
"127.0.0.1";
69 socket_request.request.destAddress =
"127.0.0.2";
70 socket_request.request.port = 54786;
71 socket_request.request.isMulticast =
false;
75 ASSERT_EQ(create_socket_client_.
call(socket_request),
true);
79 TEST(UdpTestSuite, testSendService)
87 udp_com::UdpSend send_request;
89 send_request.request.address =
"127.0.0.2";
90 send_request.request.srcPort = 54786;
91 send_request.request.dstPort = 54786;
96 ASSERT_EQ(send_service_client_.
call(send_request),
true);
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
bool call(MReq &req, MRes &res)
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))