YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
LLM_nws_yarp_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include <yarp/os/Network.h>
11
12#include <catch2/catch_amalgamated.hpp>
13#include <harness.h>
14
15using namespace yarp::dev;
16using namespace yarp::os;
17
18TEST_CASE("dev::llm_nws_yarp", "[yarp::dev]")
19{
20 YARP_REQUIRE_PLUGIN("fakeLLMDevice", "device");
21 YARP_REQUIRE_PLUGIN("LLM_nws_yarp", "device");
22
23 Network::setLocalMode(true);
24
25 SECTION("Checking llm_nws_yarp device opening without attached device")
26 {
27 PolyDriver dd;
28
30 {
32 p_cfg.put("device", "LLM_nws_yarp");
33 p_cfg.put("name", "/LLM_nws");
34 REQUIRE(dd.open(p_cfg));
35 }
36
38
39 //"Close all polydrivers and check"
40 {
41 CHECK(dd.close());
42 }
43 }
44
45 SECTION("Checking llm_nws_yarp device")
46 {
49
51 {
53 pnws_cfg.put("device", "LLM_nws_yarp");
54 pnws_cfg.put("name", "/LLM_nws");
57
59 pdev_cfg.put("device", "fakeLLMDevice");
62
65 bool result_att = ww_nws->attach(&ddfake);
67 }
68
70
71 //"Close all polydrivers and check"
72 {
73 CHECK(ddnws.close());
75 }
76 }
77
78 Network::setLocalMode(false);
79}
TEST_CASE("dev::llm_nws_yarp", "[yarp::dev]")
A container for a device driver.
Definition PolyDriver.h:23
bool close() override
Close the DeviceDriver.
bool open(const std::string &txt)
Construct and configure a device by its common name.
Helper interface for an object that can wrap/or "attach" to a single other device.
A mini-server for performing network communication in the background.
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 class for storing options and configuration information.
Definition Property.h:33
void exec_params_test(yarp::dev::PolyDriver *pdrv)
For streams capable of holding different kinds of content, check what they actually have.
void delay(double seconds)
Wait for a certain number of seconds.
Definition Time.cpp:111
An interface to the operating system, including Port based communication.
Definition OSTestMsg.cpp:13