test
hfl110dcu-utils-test.cpp
Go to the documentation of this file.
1
// Copyright 2020 Continental AG
2
// All rights reserved.
3
//
4
// Software License Agreement (BSD License 2.0)
5
//
6
// Redistribution and use in source and binary forms, with or without
7
// modification, are permitted provided that the following conditions
8
// are met:
9
//
10
// * Redistributions of source code must retain the above copyright
11
// notice, this list of conditions and the following disclaimer.
12
// * Redistributions in binary form must reproduce the above
13
// copyright notice, this list of conditions and the following
14
// disclaimer in the documentation and/or other materials provided
15
// with the distribution.
16
// * Neither the name of Continental AG nor the names of its
17
// contributors may be used to endorse or promote products derived
18
// from this software without specific prior written permission.
19
//
20
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
// POSSIBILITY OF SUCH DAMAGE.
32
33
39
40
#include <gtest/gtest.h>
41
#include <
base_hfl110dcu.h
>
42
#include <vector>
43
44
// create dummy HFL110DCU class
45
class
HFL110DCU
:
public
hfl::BaseHFL110DCU
46
{
47
public
:
48
HFL110DCU
()
49
{
50
// initialize values to helper class
51
model_
=
"hfl110dcu"
;
52
version_
=
"v1"
;
53
ip_address_
=
"192.168.10.21"
;
54
frame_data_port_
= 1900;
55
uint16_t height = 32;
56
uint16_t width = 128;
57
uint16_t returns = 2;
58
uint16_t slices = 128;
59
};
60
61
// NOTE: these are the functions that will need to be written
62
// in the actual image_processor classes
63
//
64
bool
parseFrame
(
int
start_byte,
const
std::vector<unsigned char>&)
override
65
{
66
return
true
;
67
};
68
// TODO(evan_flynn): should this return a bool to indicate status?
69
bool
processFrameData
(
const
std::vector<uint8_t>& data)
override
70
{
71
return
true
;
72
};
73
};
74
78
class
HFL110DCUFixture
:
public
::testing::Test
79
{
80
public
:
84
HFL110DCUFixture
()
85
{
86
// initialization code here
87
}
88
92
~HFL110DCUFixture
()
93
{
94
// cleanup any pending stuff, but no exceptions allowed
95
}
96
97
void
SetUp
()
98
{
99
// code here will execute just before the test ensues
100
}
101
102
void
TearDown
()
103
{
104
// code here will be called just after the test completes
105
// ok to through exceptions from here if need be
106
}
107
108
// put in any custom data members that you need
109
// the hfl interface class variable
110
HFL110DCU
*
flash_
;
111
// default helper data members
112
};
// end of HFL110DCUFixture class
113
117
118
TEST_F
(
HFL110DCUFixture
, testTEST)
119
{
120
ASSERT_EQ(
true
,
true
);
121
}
122
123
TEST_F
(
HFL110DCUFixture
, testModelParam)
124
{
125
// Test getModel function
126
// ASSERT_EQ(flash_->getModel(), "hfl110dcu"); // Equal To
127
ASSERT_EQ(
true
,
true
);
128
}
129
130
TEST_F
(
HFL110DCUFixture
, testVersionParam)
131
{
132
// Test getVersion function
133
// ASSERT_EQ(flash_->getVersion(), "v1"); // Equal To
134
ASSERT_EQ(
true
,
true
);
135
}
136
hfl::BaseHFL110DCU
Base class for the HFL110DCU cameras.
Definition:
base_hfl110dcu.h:66
HFL110DCUFixture::SetUp
void SetUp()
Definition:
hfl110dcu-utils-test.cpp:97
HFL110DCU::HFL110DCU
HFL110DCU()
Definition:
hfl110dcu-utils-test.cpp:48
HFL110DCUFixture
Definition:
hfl110dcu-utils-test.cpp:78
hfl::HflInterface::version_
std::string version_
Current camera model.
Definition:
hfl_interface.h:102
base_hfl110dcu.h
This file defines the HFL110DCU camera base class.
HFL110DCU
Definition:
hfl110dcu-utils-test.cpp:45
hfl::HflInterface::model_
std::string model_
Current camera model.
Definition:
hfl_interface.h:99
hfl::HflInterface::ip_address_
std::string ip_address_
Camera's IP address.
Definition:
hfl_interface.h:105
TEST_F
TEST_F(HFL110DCUFixture, testTEST)
Definition:
hfl110dcu-utils-test.cpp:118
HFL110DCUFixture::flash_
HFL110DCU * flash_
Definition:
hfl110dcu-utils-test.cpp:110
hfl::HflInterface::frame_data_port_
uint16_t frame_data_port_
Camera's UDP frame data port.
Definition:
hfl_interface.h:108
HFL110DCUFixture::HFL110DCUFixture
HFL110DCUFixture()
Definition:
hfl110dcu-utils-test.cpp:84
HFL110DCUFixture::TearDown
void TearDown()
Definition:
hfl110dcu-utils-test.cpp:102
HFL110DCUFixture::~HFL110DCUFixture
~HFL110DCUFixture()
Definition:
hfl110dcu-utils-test.cpp:92
HFL110DCU::parseFrame
bool parseFrame(int start_byte, const std::vector< unsigned char > &) override
Definition:
hfl110dcu-utils-test.cpp:64
HFL110DCU::processFrameData
bool processFrameData(const std::vector< uint8_t > &data) override
Definition:
hfl110dcu-utils-test.cpp:69
hfl_driver
Author(s): Evan Flynn
, Maxton Ginier
, Gerardo Bravo
, Moises Diaz
autogenerated on Wed Mar 2 2022 00:22:32