YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
joypadControlServer_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>
12
13#include <string>
14
15#include <catch2/catch_amalgamated.hpp>
16#include <harness.h>
17
18using namespace yarp::os;
19using namespace yarp::dev;
20using namespace yarp::sig;
21
22
23TEST_CASE("dev::joypadControlServerTest", "[yarp::dev]")
24{
25 YARP_REQUIRE_PLUGIN("fakeJoypad", "device");
26 YARP_REQUIRE_PLUGIN("JoypadControlServer", "device");
27
28 Network::setLocalMode(true);
29
30 SECTION("Test the nws alone")
31 {
34
35 p_nws.put("device", "JoypadControlServer");
36 p_nws.put("name", "/joyServer");
37
40
42 }
43
44 SECTION("Test the nws attached to the fake device")
45 {
50
51 p_nws.put("device", "JoypadControlServer");
52 p_nws.put("use_separate_ports", true);
53 p_nws.put("name", "/joyServer");
54
55 p_fake.put("device", "fakeJoypad");
56
60
63 bool result_att = ww_nws->attach(&dd_fake);
65
67
70 }
71
72 Network::setLocalMode(false);
73}
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:33
static void delaySystem(double seconds)
TEST_CASE("dev::joypadControlServerTest", "[yarp::dev]")
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13
An interface to the operating system, including Port based communication.