YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
audioRecorder_nws_yarp_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7
8#include <yarp/os/Network.h>
9#include <yarp/sig/Image.h>
10#include <yarp/sig/Vector.h>
11#include <yarp/dev/PolyDriver.h>
13#include <yarp/os/Time.h>
14
15#include <string>
16
17#include <catch2/catch_amalgamated.hpp>
18#include <harness.h>
19
20using namespace yarp::os;
21using namespace yarp::dev;
22using namespace yarp::sig;
23
24void test_fakeMicrophone (size_t channels)
25{
30
31 p_nws.put("device", "audioRecorder_nws_yarp");
32 p_nws.put("start", "");
33 p_fake.put("device", "fakeMicrophone");
34
35 char buff_channels[10];
36 snprintf (buff_channels, sizeof(buff_channels), "%d", (int)channels);
37 Property& psub = p_fake.addGroup("AUDIO_BASE");
38 psub.put("channels", (int)(channels));
39
43
46 bool result_att = ww_nws->attach(&dd_fake);
48
50
53}
54
55TEST_CASE("dev::AudioRecorder_nws_yarp", "[yarp::dev]")
56{
57 YARP_REQUIRE_PLUGIN("fakeMicrophone", "device");
58 YARP_REQUIRE_PLUGIN("audioRecorder_nws_yarp", "device");
59
60 Network::setLocalMode(true);
61
62 SECTION("Test the audioRecorder_nws_yarp device with no devices attached")
63 {
66
67 p_nws.put("device", "audioRecorder_nws_yarp");
70
72
74 }
75
76 SECTION("Test the audioRecorder_nws_yarp device with a fakeMicrophone device")
77 {
80 }
81
82 Network::setLocalMode(false);
83}
contains the definition of a Vector type
TEST_CASE("dev::AudioRecorder_nws_yarp", "[yarp::dev]")
void test_fakeMicrophone(size_t channels)
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)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.