YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
DeviceTemplate_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include <yarp/os/Network.h>
9
10#include <catch2/catch_amalgamated.hpp>
11#include <harness.h>
12
13using namespace yarp::dev;
14using namespace yarp::os;
15
16TEST_CASE("dev::deviceTemplate_test", "[yarp::dev]")
17{
18 YARP_REQUIRE_PLUGIN("deviceTemplate", "device");
19
20 Network::setLocalMode(true);
21
22 SECTION("Checking the device")
23 {
24 PolyDriver dd;
25
26 //"Checking opening device"
27 {
29 pcfg.put("device", "deviceTemplate");
30 REQUIRE(dd.open(pcfg));
31 }
32
33 //Do something
34 //...
35
36 //"Close all polydrivers and check"
37 {
38 CHECK(dd.close());
39 }
40 }
41
42 Network::setLocalMode(false);
43}
TEST_CASE("dev::deviceTemplate_test", "[yarp::dev]")
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
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.