YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
openCVGrabber_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
6#include <yarp/os/Network.h>
7#include <yarp/os/LogStream.h>
11
12#include <catch2/catch_amalgamated.hpp>
13#include <harness.h>
14
15using namespace yarp::dev;
16using namespace yarp::os;
17
18TEST_CASE("dev::openCVGrabberTest", "[yarp::dev]")
19{
20 YARP_REQUIRE_PLUGIN("openCVGrabber", "device");
21
22 Network::setLocalMode(true);
23
24 SECTION("Checking openCVGrabber device, opening an avi file")
25 {
26 PolyDriver dd;
27
29 res.setDefaultContext("tests/openCVGrabber");
30 std::string filepath = res.findFileByName("test.avi");
31
33 {
35 cfg.put("device", "openCVGrabber");
36 cfg.put("movie", filepath);
37 REQUIRE(dd.open(cfg));
38 }
39
41
42 //"Close all polydrivers and check"
43 {
44 CHECK(dd.close());
45 }
46 }
47
48 Network::setLocalMode(false);
49}
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
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.
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::openCVGrabberTest", "[yarp::dev]")