YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
CliMock.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#pragma once
20
21#include "gmock/gmock.h"
22#include "gtest/gtest.h"
24
29 public:
30 MOCK_METHOD(bool, setFeature, (int, double), (override));
31 MOCK_METHOD(bool, getFeature, (int, double *), (override));
32
33 bool getCameraDescription(CameraDescriptor *camera) override { return true; };
34 bool hasFeature(int feature, bool *hasFeature) override { return true; };
35 bool setFeature(int feature, double value1, double value2) override {
36 return true;
37 };
38 bool getFeature(int feature, double *value1, double *value2) override {
39 return true;
40 };
41 bool hasOnOff(int feature, bool *HasOnOff) override { return true; };
42 bool setActive(int feature, bool onoff) override { return true; };
43 bool getActive(int feature, bool *isActive) override { return true; };
44 bool hasAuto(int feature, bool *hasAuto) override { return true; };
45 bool hasManual(int feature, bool *hasManual) override { return true; };
46 bool hasOnePush(int feature, bool *hasOnePush) override { return true; };
47 bool setMode(int feature, FeatureMode mode) override { return true; };
48 bool getMode(int feature, FeatureMode *mode) override { return true; };
49 bool setOnePush(int feature) override { return true; };
50};
Mocking class created to replace the grabber object.
Definition CliMock.h:28
bool getMode(int feature, FeatureMode *mode) override
Get the current mode for the feature.
Definition CliMock.h:48
bool setOnePush(int feature) override
Set the requested feature to a value (saturation, brightness ... )
Definition CliMock.h:49
bool getActive(int feature, bool *isActive) override
Get the current status of the feature, on or off.
Definition CliMock.h:43
bool hasOnePush(int feature, bool *hasOnePush) override
Check if the requested feature has the 'onePush' mode.
Definition CliMock.h:46
bool hasAuto(int feature, bool *hasAuto) override
Check if the requested feature has the 'auto' mode.
Definition CliMock.h:44
bool getCameraDescription(CameraDescriptor *camera) override
Get a basic description of the camera hw.
Definition CliMock.h:33
bool getFeature(int feature, double *value1, double *value2) override
Get the current value for the requested feature.
Definition CliMock.h:38
bool hasFeature(int feature, bool *hasFeature) override
Check if camera has the requested feature (saturation, brightness ... )
Definition CliMock.h:34
MOCK_METHOD(bool, getFeature,(int, double *),(override))
MOCK_METHOD(bool, setFeature,(int, double),(override))
bool hasOnOff(int feature, bool *HasOnOff) override
Check if the camera has the ability to turn on/off the requested feature.
Definition CliMock.h:41
bool hasManual(int feature, bool *hasManual) override
Check if the requested feature has the 'manual' mode.
Definition CliMock.h:45
bool setFeature(int feature, double value1, double value2) override
Set the requested feature to a value using 2 params (like white balance)
Definition CliMock.h:35
bool setActive(int feature, bool onoff) override
Set the requested feature on or off.
Definition CliMock.h:42
bool setMode(int feature, FeatureMode mode) override
Set the requested mode for the feature.
Definition CliMock.h:47
Control interface for frame grabber devices.