YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
openCVWriter_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025-2025 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include <yarp/os/Network.h>
7#include <yarp/os/LogStream.h>
11
13#include <catch2/catch_amalgamated.hpp>
14#include <harness.h>
15
16using namespace yarp::dev;
17using namespace yarp::os;
18
19TEST_CASE("dev::openCVWriterTest", "[yarp::dev]")
20{
21 YARP_REQUIRE_PLUGIN("openCVWriter", "device");
22
23 Network::setLocalMode(true);
24
25 SECTION("Checking openCVWriter device")
26 {
27 PolyDriver dd;
28
30
31 //This is not yet used
32 res.setDefaultContext("tests/openCVWriter");
33 std::string filepath = res.findFileByName("test.avi");
34
36 {
38 cfg.put("device", "openCVWriter");
39 cfg.put("framerate", 30);
40 cfg.put("width", 320);
41 cfg.put("height", 240);
42 cfg.put("filename", filepath);
43 REQUIRE(dd.open(cfg));
45 }
46
48
49 //"Close all polydrivers and check"
50 {
51 CHECK(dd.close());
52 }
53 }
54
55 Network::setLocalMode(false);
56}
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:32
Helper class for finding config files and other external resources.
bool setDefaultContext(const std::string &contextName)
Sets the context for the current ResourceFinder object.
std::string findFileByName(const std::string &name)
Find the full path to a file.
void exec_params_test(yarp::dev::PolyDriver *pdrv)
For streams capable of holding different kinds of content, check what they actually have.
void delay(double seconds)
Wait for a certain number of seconds.
Definition Time.cpp:111
An interface to the operating system, including Port based communication.
TEST_CASE("dev::openCVWriterTest", "[yarp::dev]")