YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ParametersTest.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026-2026 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef PARAMETERSTEST_H
7#define PARAMETERSTEST_H
8
10#include <yarp/dev/PolyDriver.h>
11#include <catch2/catch_amalgamated.hpp>
12
13using namespace yarp::dev;
14using namespace yarp::os;
15
16namespace yarp::dev::tests
17{
19 {
20 REQUIRE(pdrv !=nullptr);
21
23 pdrv->view(iparams);
24 if (!iparams)
25 {
26 WARN("The device does not implement IDeviceDriverParams interface");
27 return;
28 }
29
30 std::string configuration = iparams->getConfiguration();
31 CHECK(!configuration.empty());
32
33 std::string class_name = iparams->getDeviceClassName();
34 CHECK(!class_name.empty());
35
36 std::string device_name = iparams->getDeviceName();
37 CHECK(!device_name.empty());
38
39 std::string doc = iparams->getDocumentationOfDeviceParams();
40 CHECK(!doc.empty());
41
42 std::string tmp;
43 CHECK(!iparams->getParamValue("not_existing_param", tmp));
44 CHECK(tmp.empty());
45
46 auto listofparams = iparams->getListOfParams();
47 for (const auto& name : listofparams)
48 {
49 //let's check that the parameter exists and we can get its value
50 std::string value;
51 bool b= iparams->getParamValue(name, value);
52 CHECK(b);
53
54 //Some string can be empty, and that's ok
55 //CHECK(!value.empty());
56 }
57 }
58}
59
60#endif
An interface for the management of the parameters of a DeviceDriver.
A container for a device driver.
Definition PolyDriver.h:23
A mini-server for performing network communication in the background.
void exec_params_test(yarp::dev::PolyDriver *pdrv)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.