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
9
10#include <yarp/os/Network.h>
11#include <yarp/sig/Image.h>
12#include <yarp/sig/Vector.h>
13#include <yarp/dev/PolyDriver.h>
15#include <yarp/os/Time.h>
16
17#include <string>
18
19#include <catch2/catch_amalgamated.hpp>
20#include <harness.h>
21
22using namespace yarp::os;
23using namespace yarp::dev;
24using namespace yarp::sig;
25
26
27TEST_CASE("dev::battery_nwc_yarp", "[yarp::dev]")
28{
29 YARP_REQUIRE_PLUGIN("fakeBattery", "device");
30 YARP_REQUIRE_PLUGIN("battery_nwc_yarp", "device");
31 YARP_REQUIRE_PLUGIN("battery_nws_yarp", "device");
32
33 Network::setLocalMode(true);
34
35 SECTION("Test the battery_nwc_yarp device with a battery_nws_yarp device")
36 {
43
44 p_nws.put("device","battery_nws_yarp");
45 p_nws.put("name", "/battery_nws");
46 p_fake.put("device","fakeBattery");
50
53 bool result_att = ww_nws->attach(&dd_fake);
55
56 p_nwc.put("device", "battery_nwc_yarp");
57 p_nwc.put("remote", "/battery_nws");
58 p_nwc.put("local", "/battery_nwc");
59 p_nwc.put("no_stream", 1);
61
62 IBattery* ibattery = nullptr;
63 REQUIRE(dd_nwc.view(ibattery));
64
66
68
70
74 }
75
76 Network::setLocalMode(false);
77}
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:33
static void delaySystem(double seconds)
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.