YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeBattery_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
7#include <yarp/os/Network.h>
10
11#include <catch2/catch_amalgamated.hpp>
12#include <harness.h>
13
14using namespace yarp::dev;
15using namespace yarp::os;
16
17TEST_CASE("dev::fakeBattery", "[yarp::dev]")
18{
19 YARP_REQUIRE_PLUGIN("fakeBattery", "device");
20
21 Network::setLocalMode(true);
22
23 SECTION("Checking fakeBattery device")
24 {
25 PolyDriver dd;
27
29 {
31 p_cfg.put("device", "fakeBattery");
32 REQUIRE(dd.open(p_cfg));
33 }
34
35 dd.view(ibatt);
37
38 //"Close all polydrivers and check"
39 {
40 CHECK(dd.close());
41 }
42 }
43
44 Network::setLocalMode(false);
45}
bool view(T *&x)
Get an interface to the device driver.
A generic battery interface.
Definition IBattery.h:26
A container for a device driver.
Definition PolyDriver.h:23
bool close() override
Close the DeviceDriver.
bool open(const std::string &txt)
Construct and configure a device by its common name.
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
Definition Property.h:33
TEST_CASE("dev::fakeBattery", "[yarp::dev]")
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.