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
46 {
47 public:
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:
85  {
86  // initialization code here
87  }
88 
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
111  // default helper data members
112 }; // end of HFL110DCUFixture class
113 
117 
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 
bool parseFrame(int start_byte, const std::vector< unsigned char > &) override
uint16_t frame_data_port_
Camera&#39;s UDP frame data port.
bool processFrameData(const std::vector< uint8_t > &data) override
std::string version_
Current camera model.
Base class for the HFL110DCU cameras.
TEST_F(HFL110DCUFixture, testTEST)
std::string ip_address_
Camera&#39;s IP address.
This file defines the HFL110DCU camera base class.
std::string model_
Current camera model.
Definition: hfl_interface.h:99


hfl_driver
Author(s): Evan Flynn , Maxton Ginier , Gerardo Bravo , Moises Diaz
autogenerated on Sat Mar 20 2021 02:27:31