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>
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::battery_nws_yarp", "[yarp::dev]")
25{
26 YARP_REQUIRE_PLUGIN("fakeBattery", "device");
27 YARP_REQUIRE_PLUGIN("battery_nws_yarp", "device");
28
29 Network::setLocalMode(true);
30
31 SECTION("Test the battery_nws_yarp device with no device attached")
32 {
35
36 p_nws.put("device","battery_nws_yarp");
37 p_nws.put("name", "/battery");
42 }
43
44 SECTION("Test the battery_nws_yarp device with fakeBattery device attached")
45 {
50
51 p_nws.put("device", "battery_nws_yarp");
52 p_nws.put("name", "/battery");
53 p_fake.put("device", "fakeBattery");
57
60 bool result_att = ww_nws->attach(&dd_fake);
62
64
67 }
68
69 Network::setLocalMode(false);
70}
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:32
static void delaySystem(double seconds)
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.