YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeFrameGrabber_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
15
16#include <yarp/os/Network.h>
17#include <yarp/sig/Image.h>
18#include <yarp/sig/Vector.h>
19#include <yarp/dev/PolyDriver.h>
20#include <yarp/os/Time.h>
21
22#include <array>
23#include <string>
24
25#include <catch2/catch_amalgamated.hpp>
26#include <harness.h>
27
28using namespace yarp::os;
29using namespace yarp::dev;
30using namespace yarp::sig;
31
32
33TEST_CASE("dev::fakeFrameGrabberTest", "[yarp::dev]")
34{
35 YARP_REQUIRE_PLUGIN("fakeFrameGrabber", "device");
36
37 Network::setLocalMode(true);
38
39 SECTION("Test the IFrameGrabberImage interface")
40 {
41 // Open the device
42 PolyDriver dd;
43 Property p;
44 p.put("device", "fakeFrameGrabber");
45 REQUIRE(dd.open(p));
47
48 // Get the IFrameGrabberImage interface
49 IFrameGrabberImage* iFrameGrabberImage = nullptr;
50 REQUIRE(dd.view(iFrameGrabberImage));
51
53
54 // Close the device
55 CHECK(dd.close());
56 }
57
58
59 SECTION("Test the IRgbVisualParams interface")
60 {
61 // Open the device
62 PolyDriver dd;
63 Property p;
64 p.put("device","fakeFrameGrabber");
65 REQUIRE(dd.open(p));
66
67 // Get the IRgbVisualParams interface
68 IRgbVisualParams* rgbParams = nullptr;
70
72
73 // Close the device
74 CHECK(dd.close()); // client close reported successful
75 }
76
77 SECTION("Test the IFrameGrabberControls interface")
78 {
79 // Open the device
80 PolyDriver dd;
81 Property p;
82 p.put("device","fakeFrameGrabber");
83 REQUIRE(dd.open(p));
84
85 // Get the IRgbVisualParams interface
86 IFrameGrabberControls* ictl = nullptr;
87 REQUIRE(dd.view(ictl));
88
90
91 // Close the device
92 CHECK(dd.close()); // client close reported successful
93 }
94
95 SECTION("Test the IFrameGrabberControlsDC1394 interface")
96 {
97 // Open the device
98 PolyDriver dd;
99 Property p;
100 p.put("device","fakeFrameGrabber");
101 REQUIRE(dd.open(p));
102
103 // Get the IRgbVisualParams interface
105 REQUIRE(dd.view(ictl));
106
108
109 // Close the device
110 CHECK(dd.close()); // client close reported successful
111 }
112
113 Network::setLocalMode(false);
114}
contains the definition of a Vector type
bool view(T *&x)
Get an interface to the device driver.
Control interface for frame grabber devices that conform to the 1394-based Digital Camera Specificati...
Control interface for frame grabber devices.
An interface for retrieving intrinsic parameter from a rgb camera.
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
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Definition Property.cpp:987
TEST_CASE("dev::fakeFrameGrabberTest", "[yarp::dev]")
void exec_IFrameGrabberControlsDC1394_test_1(IFrameGrabberControlsDC1394 *ictl)
void exec_params_test(yarp::dev::PolyDriver *pdrv)
void exec_IFrameGrabberControls_test_1(IFrameGrabberControls *ictl)
void exec_IRgbVisualParams_test_1(IRgbVisualParams *irgb)
void exec_IFrameGrabberImage_test_1(IFrameGrabberImage *iframe)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.
Definition OSTestMsg.cpp:13