YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
joypadControl_nws_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/os/Network.h>
7#include <yarp/sig/Image.h>
8#include <yarp/sig/Vector.h>
10#include <yarp/os/Time.h>
13
14#include <string>
15
16#include <catch2/catch_amalgamated.hpp>
17#include <harness.h>
18
19using namespace yarp::os;
20using namespace yarp::dev;
21using namespace yarp::sig;
22
23
24TEST_CASE("dev::joypadControl_nws_yarp", "[yarp::dev]")
25{
26 YARP_REQUIRE_PLUGIN("fakeJoypad", "device");
27 YARP_REQUIRE_PLUGIN("JoypadControl_nws_yarp", "device");
28
29 Network::setLocalMode(true);
30
32 bool(true),
33 bool(false)
34 );
35
36 SECTION("Test the nws alone")
37 {
40
41 p_nws.put("device", "JoypadControl_nws_yarp");
42 p_nws.put("name", "/joy_nws_yarp");
43
46
48 }
49
50 SECTION("Test the nws attached to the fake device")
51 {
56
57 p_nws.put("device", "JoypadControl_nws_yarp");
58 p_nws.put("profile", true);
59 p_nws.put("name", "/joy_nws_yarp");
60 p_nws.put("publish_on_event",publish_on_event_config);
61
62 p_fake.put("device", "fakeJoypad");
63
66
69
71
74 bool result_att = ww_nws->attach(&dd_fake);
76
78
81 }
82
83 Network::setLocalMode(false);
84}
contains the definition of a Vector type
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:32
static void delaySystem(double seconds)
TEST_CASE("dev::joypadControl_nws_yarp", "[yarp::dev]")
void exec_params_test(yarp::dev::PolyDriver *pdrv)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.