21#include <catch2/catch_amalgamated.hpp>
26 YARP_REQUIRE_PLUGIN(
"rpc_monitor",
"portmonitor")
42 TestCase {
"fast_tcp",
false},
43 TestCase {
"fast_tcp+send.portmonitor+file.rpc_monitor+monitor_name./monitor_data_receiver+type.dll",
true}
46 SECTION(
"Quick Test RPC monitoring - monitor = " + std::string(tc.use_monitor ?
"enabled" :
"disabled"))
53 receiver.
open(
"/recv");
56 monitorport.
open(
"/monitor_data_receiver");
76 SECTION(
"Advanced Test RPC monitoring - monitor = " + std::string(tc.use_monitor ?
"enabled" :
"disabled"))
82 client.
open(
"/rpc_client");
83 server.
open(
"/rpc_server");
86 monitor.
open(
"/monitor_data_receiver");
95 std::thread server_thread([&server]() {
98 server.
read(cmd,
true);
110 client.
write(cmd, reply);
114 server_thread.join();
117 REQUIRE(reply.
size() == 2);
121 if (tc.use_monitor) {
A simple collection of objects that can be described and transmitted in a portable way.
size_type size() const
Gets the number of elements in the bottle.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
static Carrier * getCarrierTemplate(const std::string &name)
Get template for carrier.
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
static bool setLocalMode(bool flag)
Chooses whether communication is process-local.
Utilities for manipulating the YARP network, including initialization and shutdown.
A mini-server for network communication.
bool write(const PortWriter &writer, const PortWriter *callback=nullptr) const override
Write an object to the port.
bool read(PortReader &reader, bool willReply=false) override
Read an object from the port.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A port that is specialized as an RPC client.
A port that is specialized as an RPC server.
bool read(PortReader &reader, bool willReply=true) override
Read an object from the port.
A single value (typically within a Bottle).
virtual std::int32_t asInt32() const
Get 32-bit integer value.
virtual std::string asString() const
Get string value.
void delay(double seconds)
Wait for a certain number of seconds.
The main, catch-all namespace for YARP.
TEST_CASE("pm::rpc_monitorTest", "[yarp::pm]")