20#include <catch2/catch_amalgamated.hpp>
25 YARP_REQUIRE_PLUGIN(
"throttleDown",
"portmonitor")
40 double expected_receive_rate;
46 TestCase {
"fast_tcp", 42, 0, 10.0, 10.0, 2.0},
48 TestCase {
"fast_tcp+send.portmonitor+type.dll+file.throttleDown+period_ms.500", 42, 500, 10.0, 2.0, 1.0},
50 TestCase {
"fast_tcp+send.portmonitor+type.dll+file.throttleDown+period_ms.200", 42, 200, 10.0, 5.0, 2.0}
53 SECTION(
"Test throttling behavior - sending at " + std::to_string(tc.send_rate) +
" Hz, expecting ~" + std::to_string(tc.expected_receive_rate) +
" Hz")
59 receiver.
open(
"/recv");
73 CHECK(rval.
asInt64()==tc.value_to_send);
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 single value (typically within a Bottle).
virtual std::int64_t asInt64() const
Get 64-bit integer value.
void delay(double seconds)
Wait for a certain number of seconds.
The main, catch-all namespace for YARP.
TEST_CASE("pm::throttleDownTest", "[yarp::pm]")