YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeAnalogSensor_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::fakeAnalogSensor", "[yarp::dev]")
18{
19 YARP_REQUIRE_PLUGIN("fakeAnalogSensor", "device");
20
21 Network::setLocalMode(true);
22
23 SECTION("Checking fakeAnalogSensor device")
24 {
27
29 {
31 p_cfg.put("device", "fakeAnalogSensor");
32 p_cfg.put("period", "0.010");
34 }
35
36 ddmc.view(ianalog);
37 CHECK(ianalog->getChannels()==1);
38
39 //"Close all polydrivers and check"
40 {
41 CHECK(ddmc.close());
42 }
43 }
44
45 Network::setLocalMode(false);
46}
analog sensor interface
A generic interface to sensors (gyro, a/d converters).
A container for a device driver.
Definition PolyDriver.h:23
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
TEST_CASE("dev::fakeAnalogSensor", "[yarp::dev]")
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.