YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
battery_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>
11#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::battery_nws_yarp", "[yarp::dev]")
24{
25 YARP_REQUIRE_PLUGIN("fakeBattery", "device");
26 YARP_REQUIRE_PLUGIN("battery_nws_yarp", "device");
27
28 Network::setLocalMode(true);
29
30 SECTION("Test the battery_nws_yarp device with no device attached")
31 {
34
35 p_nws.put("device","battery_nws_yarp");
36 p_nws.put("name", "/battery");
40 }
41
42 SECTION("Test the battery_nws_yarp device with fakeBattery device attached")
43 {
48
49 p_nws.put("device", "battery_nws_yarp");
50 p_nws.put("name", "/battery");
51 p_fake.put("device", "fakeBattery");
55
58 bool result_att = ww_nws->attach(&dd_fake);
60
62
65 }
66
67 Network::setLocalMode(false);
68}
contains the definition of a Vector type
TEST_CASE("dev::battery_nws_yarp", "[yarp::dev]")
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)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.