YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
battery_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/IBattery.h>
7
10
11#include <yarp/os/Network.h>
12#include <yarp/sig/Image.h>
13#include <yarp/sig/Vector.h>
14#include <yarp/dev/PolyDriver.h>
16#include <yarp/os/Time.h>
17
18#include <string>
19
20#include <catch2/catch_amalgamated.hpp>
21#include <harness.h>
22
23using namespace yarp::os;
24using namespace yarp::dev;
25using namespace yarp::sig;
26
27
28TEST_CASE("dev::battery_nwc_yarp", "[yarp::dev]")
29{
30 YARP_REQUIRE_PLUGIN("fakeBattery", "device");
31 YARP_REQUIRE_PLUGIN("battery_nwc_yarp", "device");
32 YARP_REQUIRE_PLUGIN("battery_nws_yarp", "device");
33
34 Network::setLocalMode(true);
35
36 SECTION("Test the battery_nwc_yarp device with a battery_nws_yarp device")
37 {
44
45 p_nws.put("device","battery_nws_yarp");
46 p_nws.put("name", "/battery_nws");
47 p_fake.put("device","fakeBattery");
51
54 bool result_att = ww_nws->attach(&dd_fake);
56
57 p_nwc.put("device", "battery_nwc_yarp");
58 p_nwc.put("remote", "/battery_nws");
59 p_nwc.put("local", "/battery_nwc");
60 p_nwc.put("no_stream", 1);
63
64 IBattery* ibattery = nullptr;
65 REQUIRE(dd_nwc.view(ibattery));
66
68
70
72
76 }
77
78 Network::setLocalMode(false);
79}
contains the definition of a Vector type
TEST_CASE("dev::battery_nwc_yarp", "[yarp::dev]")
A generic battery interface.
Definition IBattery.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:32
static void delaySystem(double seconds)
void exec_params_test(yarp::dev::PolyDriver *pdrv)
void exec_iBattery_test_1(IBattery *ibat)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.