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>
13#include <harness.h>
14
15using namespace yarp::dev;
16using namespace yarp::os;
17
18TEST_CASE("dev::ChatBot_nwc", "[yarp::dev]")
19{
20 YARP_REQUIRE_PLUGIN("fakeChatBotDevice", "device");
21 YARP_REQUIRE_PLUGIN("chatBot_nws_yarp", "device");
22 YARP_REQUIRE_PLUGIN("chatBot_nwc_yarp", "device");
23
24 Network::setLocalMode(true);
25
26 SECTION("Checking chatBot_nwc device")
27 {
32
34 {
36 pnws_cfg.put("device", "chatBot_nws_yarp");
37 pnws_cfg.put("name", "/chatBot_nws");
39
41 pdev_cfg.put("device", "fakeChatBotDevice");
43
45 REQUIRE(ddnws.view(ww_nws));
46 REQUIRE(ww_nws!=nullptr);
47 bool result_att = ww_nws->attach(&ddfake);
49
51 pnwc_cfg.put("device", "chatBot_nwc_yarp");
52 pnwc_cfg.put("local", "/chatBot_nwc/rpc");
53 pnwc_cfg.put("remote", "/chatBot_nws/rpc");
55 REQUIRE(ddnwc.view(iChatBot));
56 }
57
59
60 //"Close all polydrivers and check"
61 {
62 CHECK(ddnwc.close());
64 CHECK(ddnws.close());
67 }
68 }
69
70 Network::setLocalMode(false);
71}
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)
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.