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
14
15#include <yarp/os/Network.h>
16#include <yarp/sig/Image.h>
17#include <yarp/sig/Vector.h>
18#include <yarp/dev/PolyDriver.h>
19#include <yarp/os/Time.h>
20
21#include <array>
22#include <string>
23
24#include <catch2/catch_amalgamated.hpp>
25#include <harness.h>
26
27using namespace yarp::os;
28using namespace yarp::dev;
29using namespace yarp::sig;
30
31
32TEST_CASE("dev::fakeFrameGrabberTest", "[yarp::dev]")
33{
34 YARP_REQUIRE_PLUGIN("fakeFrameGrabber", "device");
35
36 Network::setLocalMode(true);
37
38 SECTION("Test the IFrameGrabberImage interface")
39 {
40 // Open the device
41 PolyDriver dd;
42 Property p;
43 p.put("device", "fakeFrameGrabber");
44 REQUIRE(dd.open(p));
45
46 // Get the IFrameGrabberImage interface
47 IFrameGrabberImage* iFrameGrabberImage = nullptr;
48 REQUIRE(dd.view(iFrameGrabberImage));
49
51
52 // Close the device
53 CHECK(dd.close());
54 }
55
56
57 SECTION("Test the IRgbVisualParams interface")
58 {
59 // Open the device
60 PolyDriver dd;
61 Property p;
62 p.put("device","fakeFrameGrabber");
63 REQUIRE(dd.open(p));
64
65 // Get the IRgbVisualParams interface
66 IRgbVisualParams* rgbParams = nullptr;
68
70
71 // Close the device
72 CHECK(dd.close()); // client close reported successful
73 }
74
75 SECTION("Test the IFrameGrabberControls interface")
76 {
77 // Open the device
78 PolyDriver dd;
79 Property p;
80 p.put("device","fakeFrameGrabber");
81 REQUIRE(dd.open(p));
82
83 // Get the IRgbVisualParams interface
84 IFrameGrabberControls* ictl = nullptr;
85 REQUIRE(dd.view(ictl));
86
88
89 // Close the device
90 CHECK(dd.close()); // client close reported successful
91 }
92
93 SECTION("Test the IFrameGrabberControlsDC1394 interface")
94 {
95 // Open the device
96 PolyDriver dd;
97 Property p;
98 p.put("device","fakeFrameGrabber");
99 REQUIRE(dd.open(p));
100
101 // Get the IRgbVisualParams interface
103 REQUIRE(dd.view(ictl));
104
106
107 // Close the device
108 CHECK(dd.close()); // client close reported successful
109 }
110
111 Network::setLocalMode(false);
112}
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_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.