Branch data Line data Source code
1 : : /*
2 : : * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3 : : *
4 : : * Copyright (C) 2018-2021 Intel Corporation
5 : : *
6 : : * SPDX-License-Identifier: LGPL-2.1-only
7 : : *
8 : : * ----------------- END LICENSE BLOCK -----------------------------------
9 : : */
10 : :
11 : : /*
12 : : * Generated file
13 : : */
14 : :
15 : : #if defined(__clang__) && (__clang_major__ >= 7)
16 : : #pragma GCC diagnostic push
17 : : #pragma GCC diagnostic ignored "-Wself-assign-overloaded"
18 : : #endif
19 : :
20 : : #include <gtest/gtest.h>
21 : : #include <limits>
22 : : #include "ad/rss/world/UnstructuredSettings.hpp"
23 : :
24 : : class UnstructuredSettingsTests : public testing::Test
25 : : {
26 : : protected:
27 : 21 : virtual void SetUp() override
28 : : {
29 : : // valid initialization
30 : 21 : ::ad::rss::world::UnstructuredSettings value;
31 : 21 : ::ad::physics::Distance valuePedestrianTurningRadius(-1e9);
32 : 21 : value.pedestrianTurningRadius = valuePedestrianTurningRadius;
33 : 21 : ::ad::physics::Angle valueDriveAwayMaxAngle(-6.283185308);
34 : 21 : value.driveAwayMaxAngle = valueDriveAwayMaxAngle;
35 : 21 : ::ad::physics::AngularAcceleration valueVehicleYawRateChange(-1e2);
36 : 21 : value.vehicleYawRateChange = valueVehicleYawRateChange;
37 : 21 : ::ad::physics::Distance valueVehicleMinRadius(-1e9);
38 : 21 : value.vehicleMinRadius = valueVehicleMinRadius;
39 : 21 : ::ad::physics::Duration valueVehicleTrajectoryCalculationStep(0.);
40 : 21 : value.vehicleTrajectoryCalculationStep = valueVehicleTrajectoryCalculationStep;
41 : 21 : uint32_t valueVehicleFrontIntermediateYawRateChangeRatioSteps{std::numeric_limits<uint32_t>::min()};
42 : 21 : value.vehicleFrontIntermediateYawRateChangeRatioSteps = valueVehicleFrontIntermediateYawRateChangeRatioSteps;
43 : 21 : uint32_t valueVehicleBackIntermediateYawRateChangeRatioSteps{std::numeric_limits<uint32_t>::min()};
44 : 21 : value.vehicleBackIntermediateYawRateChangeRatioSteps = valueVehicleBackIntermediateYawRateChangeRatioSteps;
45 : 21 : uint32_t valueVehicleBrakeIntermediateAccelerationSteps{std::numeric_limits<uint32_t>::min()};
46 : 21 : value.vehicleBrakeIntermediateAccelerationSteps = valueVehicleBrakeIntermediateAccelerationSteps;
47 : 21 : uint32_t valueVehicleContinueForwardIntermediateAccelerationSteps{std::numeric_limits<uint32_t>::min()};
48 : : value.vehicleContinueForwardIntermediateAccelerationSteps
49 : 21 : = valueVehicleContinueForwardIntermediateAccelerationSteps;
50 : 21 : uint32_t valueVehicleContinueForwardIntermediateYawRateChangeRatioSteps{std::numeric_limits<uint32_t>::min()};
51 : : value.vehicleContinueForwardIntermediateYawRateChangeRatioSteps
52 : 21 : = valueVehicleContinueForwardIntermediateYawRateChangeRatioSteps;
53 : 21 : uint32_t valuePedestrianContinueForwardIntermediateHeadingChangeRatioSteps{std::numeric_limits<uint32_t>::min()};
54 : : value.pedestrianContinueForwardIntermediateHeadingChangeRatioSteps
55 : 21 : = valuePedestrianContinueForwardIntermediateHeadingChangeRatioSteps;
56 : 21 : uint32_t valuePedestrianContinueForwardIntermediateAccelerationSteps{std::numeric_limits<uint32_t>::min()};
57 : : value.pedestrianContinueForwardIntermediateAccelerationSteps
58 : 21 : = valuePedestrianContinueForwardIntermediateAccelerationSteps;
59 : 21 : uint32_t valuePedestrianBrakeIntermediateAccelerationSteps{std::numeric_limits<uint32_t>::min()};
60 : 21 : value.pedestrianBrakeIntermediateAccelerationSteps = valuePedestrianBrakeIntermediateAccelerationSteps;
61 : 21 : uint32_t valuePedestrianFrontIntermediateHeadingChangeRatioSteps{std::numeric_limits<uint32_t>::min()};
62 : 21 : value.pedestrianFrontIntermediateHeadingChangeRatioSteps = valuePedestrianFrontIntermediateHeadingChangeRatioSteps;
63 : 21 : uint32_t valuePedestrianBackIntermediateHeadingChangeRatioSteps{std::numeric_limits<uint32_t>::min()};
64 : 21 : value.pedestrianBackIntermediateHeadingChangeRatioSteps = valuePedestrianBackIntermediateHeadingChangeRatioSteps;
65 : 21 : mValue = value;
66 : 21 : }
67 : :
68 : : ::ad::rss::world::UnstructuredSettings mValue;
69 : : };
70 : :
71 : 2 : TEST_F(UnstructuredSettingsTests, copyConstruction)
72 : : {
73 : 1 : ::ad::rss::world::UnstructuredSettings value(mValue);
74 [ + - - + : 1 : EXPECT_EQ(mValue, value);
- - - - -
- ]
75 : 1 : }
76 : :
77 : 2 : TEST_F(UnstructuredSettingsTests, moveConstruction)
78 : : {
79 : 1 : ::ad::rss::world::UnstructuredSettings tmpValue(mValue);
80 : 1 : ::ad::rss::world::UnstructuredSettings value(std::move(tmpValue));
81 [ + - - + : 1 : EXPECT_EQ(mValue, value);
- - - - -
- ]
82 : 1 : }
83 : :
84 : 2 : TEST_F(UnstructuredSettingsTests, copyAssignment)
85 : : {
86 : 1 : ::ad::rss::world::UnstructuredSettings value;
87 : 1 : value = mValue;
88 [ + - - + : 1 : EXPECT_EQ(mValue, value);
- - - - -
- ]
89 : 1 : }
90 : :
91 : 2 : TEST_F(UnstructuredSettingsTests, moveAssignment)
92 : : {
93 : 1 : ::ad::rss::world::UnstructuredSettings tmpValue(mValue);
94 : 1 : ::ad::rss::world::UnstructuredSettings value;
95 : 1 : value = std::move(tmpValue);
96 [ + - - + : 1 : EXPECT_EQ(mValue, value);
- - - - -
- ]
97 : 1 : }
98 : :
99 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorEqual)
100 : : {
101 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
102 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
103 : :
104 [ + - - + : 1 : EXPECT_TRUE(valueA == valueB);
- - - - -
- - - ]
105 [ + - - + : 1 : EXPECT_FALSE(valueA != valueB);
- - - - -
- - - ]
106 : 1 : }
107 : :
108 : 2 : TEST_F(UnstructuredSettingsTests, stringConversionTest)
109 : : {
110 [ + - ]: 1 : std::stringstream stream;
111 [ + - ]: 1 : stream << mValue;
112 [ + - ]: 1 : std::string ostreamStr = stream.str();
113 [ + - ]: 1 : std::string toStr = std::to_string(mValue);
114 [ + - - + : 1 : ASSERT_EQ(ostreamStr, toStr);
- - - - -
- ]
115 : : }
116 : :
117 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorPedestrianTurningRadiusDiffers)
118 : : {
119 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
120 : 1 : ::ad::physics::Distance pedestrianTurningRadius(1e9);
121 : 1 : valueA.pedestrianTurningRadius = pedestrianTurningRadius;
122 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
123 : :
124 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
125 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
126 : 1 : }
127 : :
128 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorDriveAwayMaxAngleDiffers)
129 : : {
130 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
131 : 1 : ::ad::physics::Angle driveAwayMaxAngle(6.283185308);
132 : 1 : valueA.driveAwayMaxAngle = driveAwayMaxAngle;
133 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
134 : :
135 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
136 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
137 : 1 : }
138 : :
139 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorVehicleYawRateChangeDiffers)
140 : : {
141 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
142 : 1 : ::ad::physics::AngularAcceleration vehicleYawRateChange(1e2);
143 : 1 : valueA.vehicleYawRateChange = vehicleYawRateChange;
144 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
145 : :
146 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
147 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
148 : 1 : }
149 : :
150 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorVehicleMinRadiusDiffers)
151 : : {
152 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
153 : 1 : ::ad::physics::Distance vehicleMinRadius(1e9);
154 : 1 : valueA.vehicleMinRadius = vehicleMinRadius;
155 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
156 : :
157 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
158 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
159 : 1 : }
160 : :
161 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorVehicleTrajectoryCalculationStepDiffers)
162 : : {
163 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
164 : 1 : ::ad::physics::Duration vehicleTrajectoryCalculationStep(1e6);
165 : 1 : valueA.vehicleTrajectoryCalculationStep = vehicleTrajectoryCalculationStep;
166 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
167 : :
168 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
169 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
170 : 1 : }
171 : :
172 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorVehicleFrontIntermediateYawRateChangeRatioStepsDiffers)
173 : : {
174 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
175 : 1 : uint32_t vehicleFrontIntermediateYawRateChangeRatioSteps{std::numeric_limits<uint32_t>::max()};
176 : 1 : valueA.vehicleFrontIntermediateYawRateChangeRatioSteps = vehicleFrontIntermediateYawRateChangeRatioSteps;
177 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
178 : :
179 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
180 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
181 : 1 : }
182 : :
183 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorVehicleBackIntermediateYawRateChangeRatioStepsDiffers)
184 : : {
185 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
186 : 1 : uint32_t vehicleBackIntermediateYawRateChangeRatioSteps{std::numeric_limits<uint32_t>::max()};
187 : 1 : valueA.vehicleBackIntermediateYawRateChangeRatioSteps = vehicleBackIntermediateYawRateChangeRatioSteps;
188 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
189 : :
190 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
191 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
192 : 1 : }
193 : :
194 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorVehicleBrakeIntermediateAccelerationStepsDiffers)
195 : : {
196 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
197 : 1 : uint32_t vehicleBrakeIntermediateAccelerationSteps{std::numeric_limits<uint32_t>::max()};
198 : 1 : valueA.vehicleBrakeIntermediateAccelerationSteps = vehicleBrakeIntermediateAccelerationSteps;
199 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
200 : :
201 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
202 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
203 : 1 : }
204 : :
205 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorVehicleContinueForwardIntermediateAccelerationStepsDiffers)
206 : : {
207 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
208 : 1 : uint32_t vehicleContinueForwardIntermediateAccelerationSteps{std::numeric_limits<uint32_t>::max()};
209 : 1 : valueA.vehicleContinueForwardIntermediateAccelerationSteps = vehicleContinueForwardIntermediateAccelerationSteps;
210 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
211 : :
212 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
213 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
214 : 1 : }
215 : :
216 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorVehicleContinueForwardIntermediateYawRateChangeRatioStepsDiffers)
217 : : {
218 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
219 : 1 : uint32_t vehicleContinueForwardIntermediateYawRateChangeRatioSteps{std::numeric_limits<uint32_t>::max()};
220 : : valueA.vehicleContinueForwardIntermediateYawRateChangeRatioSteps
221 : 1 : = vehicleContinueForwardIntermediateYawRateChangeRatioSteps;
222 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
223 : :
224 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
225 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
226 : 1 : }
227 : :
228 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorPedestrianContinueForwardIntermediateHeadingChangeRatioStepsDiffers)
229 : : {
230 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
231 : 1 : uint32_t pedestrianContinueForwardIntermediateHeadingChangeRatioSteps{std::numeric_limits<uint32_t>::max()};
232 : : valueA.pedestrianContinueForwardIntermediateHeadingChangeRatioSteps
233 : 1 : = pedestrianContinueForwardIntermediateHeadingChangeRatioSteps;
234 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
235 : :
236 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
237 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
238 : 1 : }
239 : :
240 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorPedestrianContinueForwardIntermediateAccelerationStepsDiffers)
241 : : {
242 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
243 : 1 : uint32_t pedestrianContinueForwardIntermediateAccelerationSteps{std::numeric_limits<uint32_t>::max()};
244 : : valueA.pedestrianContinueForwardIntermediateAccelerationSteps
245 : 1 : = pedestrianContinueForwardIntermediateAccelerationSteps;
246 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
247 : :
248 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
249 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
250 : 1 : }
251 : :
252 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorPedestrianBrakeIntermediateAccelerationStepsDiffers)
253 : : {
254 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
255 : 1 : uint32_t pedestrianBrakeIntermediateAccelerationSteps{std::numeric_limits<uint32_t>::max()};
256 : 1 : valueA.pedestrianBrakeIntermediateAccelerationSteps = pedestrianBrakeIntermediateAccelerationSteps;
257 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
258 : :
259 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
260 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
261 : 1 : }
262 : :
263 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorPedestrianFrontIntermediateHeadingChangeRatioStepsDiffers)
264 : : {
265 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
266 : 1 : uint32_t pedestrianFrontIntermediateHeadingChangeRatioSteps{std::numeric_limits<uint32_t>::max()};
267 : 1 : valueA.pedestrianFrontIntermediateHeadingChangeRatioSteps = pedestrianFrontIntermediateHeadingChangeRatioSteps;
268 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
269 : :
270 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
271 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
272 : 1 : }
273 : :
274 : 2 : TEST_F(UnstructuredSettingsTests, comparisonOperatorPedestrianBackIntermediateHeadingChangeRatioStepsDiffers)
275 : : {
276 : 1 : ::ad::rss::world::UnstructuredSettings valueA = mValue;
277 : 1 : uint32_t pedestrianBackIntermediateHeadingChangeRatioSteps{std::numeric_limits<uint32_t>::max()};
278 : 1 : valueA.pedestrianBackIntermediateHeadingChangeRatioSteps = pedestrianBackIntermediateHeadingChangeRatioSteps;
279 : 1 : ::ad::rss::world::UnstructuredSettings valueB = mValue;
280 : :
281 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB);
- - - - -
- - - ]
282 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB);
- - - - -
- - - ]
283 : 1 : }
284 : :
285 : : #if defined(__clang__) && (__clang_major__ >= 7)
286 : : #pragma GCC diagnostic pop
287 : : #endif
|