YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
chatBot_nwc_yarp_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include <yarp/dev/IChatBot.h>
7#include <yarp/os/Network.h>
11
12#include <catch2/catch_amalgamated.hpp>
14
15#include <harness.h>
16
17using namespace yarp::dev;
18using namespace yarp::os;
19
20TEST_CASE("dev::ChatBot_nwc", "[yarp::dev]")
21{
22 YARP_REQUIRE_PLUGIN("fakeChatBotDevice", "device");
23 YARP_REQUIRE_PLUGIN("chatBot_nws_yarp", "device");
24 YARP_REQUIRE_PLUGIN("chatBot_nwc_yarp", "device");
25
26 Network::setLocalMode(true);
27
28 SECTION("Checking chatBot_nwc device")
29 {
34
36 {
38 pnws_cfg.put("device", "chatBot_nws_yarp");
39 pnws_cfg.put("name", "/chatBot_nws");
41
43 pdev_cfg.put("device", "fakeChatBotDevice");
45
47 REQUIRE(ddnws.view(ww_nws));
48 REQUIRE(ww_nws!=nullptr);
49 bool result_att = ww_nws->attach(&ddfake);
51
53 pnwc_cfg.put("device", "chatBot_nwc_yarp");
54 pnwc_cfg.put("local", "/chatBot_nwc/rpc");
55 pnwc_cfg.put("remote", "/chatBot_nws/rpc");
57 REQUIRE(ddnwc.view(iChatBot));
59 }
60
62
63 //"Close all polydrivers and check"
64 {
65 CHECK(ddnwc.close());
67 CHECK(ddnws.close());
70 }
71 }
72
73 Network::setLocalMode(false);
74}
TEST_CASE("dev::ChatBot_nwc", "[yarp::dev]")
IChatBot interface.
Definition IChatBot.h:26
A container for a device driver.
Definition PolyDriver.h:23
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_iChatBot_test_1(yarp::dev::IChatBot *ichatbot)
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