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/state/RssState.hpp" 23 : : 24 : : class RssStateTests : public testing::Test 25 : : { 26 : : protected: 27 : 13 : virtual void SetUp() override 28 : : { 29 : : // valid initialization 30 : 26 : ::ad::rss::state::RssState value; 31 : 13 : ::ad::rss::world::ObjectId valueObjectId(std::numeric_limits<::ad::rss::world::ObjectId>::lowest()); 32 : 13 : value.objectId = valueObjectId; 33 : 13 : ::ad::rss::situation::SituationId valueSituationId( 34 : : std::numeric_limits<::ad::rss::situation::SituationId>::lowest()); 35 : 13 : value.situationId = valueSituationId; 36 : 13 : ::ad::rss::state::LongitudinalRssState valueLongitudinalState; 37 : 13 : bool valueLongitudinalStateIsSafe{true}; 38 : 13 : valueLongitudinalState.isSafe = valueLongitudinalStateIsSafe; 39 : 13 : ::ad::rss::state::LongitudinalResponse valueLongitudinalStateResponse(::ad::rss::state::LongitudinalResponse::None); 40 : 13 : valueLongitudinalState.response = valueLongitudinalStateResponse; 41 : 13 : ::ad::rss::world::LongitudinalRssAccelerationValues valueLongitudinalStateAlphaLon; 42 : 13 : ::ad::physics::Acceleration valueLongitudinalStateAlphaLonAccelMax(-1e2); 43 : 13 : valueLongitudinalStateAlphaLonAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct 44 : 13 : valueLongitudinalStateAlphaLon.accelMax = valueLongitudinalStateAlphaLonAccelMax; 45 : 13 : ::ad::physics::Acceleration valueLongitudinalStateAlphaLonBrakeMax(-1e2); 46 : 13 : valueLongitudinalStateAlphaLon.brakeMax = valueLongitudinalStateAlphaLonBrakeMax; 47 : 13 : ::ad::physics::Acceleration valueLongitudinalStateAlphaLonBrakeMin(-1e2); 48 : 13 : valueLongitudinalStateAlphaLon.brakeMin = valueLongitudinalStateAlphaLonBrakeMin; 49 : 13 : ::ad::physics::Acceleration valueLongitudinalStateAlphaLonBrakeMinCorrect(-1e2); 50 : 13 : valueLongitudinalStateAlphaLon.brakeMinCorrect = valueLongitudinalStateAlphaLonBrakeMinCorrect; 51 : 13 : valueLongitudinalStateAlphaLon.brakeMin = valueLongitudinalStateAlphaLon.brakeMax; 52 : 13 : valueLongitudinalStateAlphaLon.brakeMinCorrect = valueLongitudinalStateAlphaLon.brakeMin; 53 : 13 : valueLongitudinalStateAlphaLon.brakeMin = valueLongitudinalStateAlphaLon.brakeMinCorrect; 54 : 13 : valueLongitudinalStateAlphaLon.brakeMax = valueLongitudinalStateAlphaLon.brakeMin; 55 : 13 : valueLongitudinalState.alphaLon = valueLongitudinalStateAlphaLon; 56 : 13 : ::ad::rss::state::RssStateInformation valueLongitudinalStateRssStateInformation; 57 : 13 : ::ad::physics::Distance valueLongitudinalStateRssStateInformationSafeDistance(-1e9); 58 : 13 : valueLongitudinalStateRssStateInformation.safeDistance = valueLongitudinalStateRssStateInformationSafeDistance; 59 : 13 : ::ad::physics::Distance valueLongitudinalStateRssStateInformationCurrentDistance(-1e9); 60 : : valueLongitudinalStateRssStateInformation.currentDistance 61 : 13 : = valueLongitudinalStateRssStateInformationCurrentDistance; 62 : 13 : ::ad::rss::state::RssStateEvaluator valueLongitudinalStateRssStateInformationEvaluator( 63 : : ::ad::rss::state::RssStateEvaluator::None); 64 : 13 : valueLongitudinalStateRssStateInformation.evaluator = valueLongitudinalStateRssStateInformationEvaluator; 65 : 13 : valueLongitudinalState.rssStateInformation = valueLongitudinalStateRssStateInformation; 66 : 13 : value.longitudinalState = valueLongitudinalState; 67 : 13 : ::ad::rss::state::LateralRssState valueLateralStateRight; 68 : 13 : bool valueLateralStateRightIsSafe{true}; 69 : 13 : valueLateralStateRight.isSafe = valueLateralStateRightIsSafe; 70 : 13 : ::ad::rss::state::LateralResponse valueLateralStateRightResponse(::ad::rss::state::LateralResponse::None); 71 : 13 : valueLateralStateRight.response = valueLateralStateRightResponse; 72 : 13 : ::ad::rss::world::LateralRssAccelerationValues valueLateralStateRightAlphaLat; 73 : 13 : ::ad::physics::Acceleration valueLateralStateRightAlphaLatAccelMax(-1e2); 74 : 13 : valueLateralStateRightAlphaLatAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct 75 : 13 : valueLateralStateRightAlphaLat.accelMax = valueLateralStateRightAlphaLatAccelMax; 76 : 13 : ::ad::physics::Acceleration valueLateralStateRightAlphaLatBrakeMin(-1e2); 77 : 13 : valueLateralStateRightAlphaLat.brakeMin = valueLateralStateRightAlphaLatBrakeMin; 78 : 13 : valueLateralStateRight.alphaLat = valueLateralStateRightAlphaLat; 79 : 13 : ::ad::rss::state::RssStateInformation valueLateralStateRightRssStateInformation; 80 : 13 : ::ad::physics::Distance valueLateralStateRightRssStateInformationSafeDistance(-1e9); 81 : 13 : valueLateralStateRightRssStateInformation.safeDistance = valueLateralStateRightRssStateInformationSafeDistance; 82 : 13 : ::ad::physics::Distance valueLateralStateRightRssStateInformationCurrentDistance(-1e9); 83 : : valueLateralStateRightRssStateInformation.currentDistance 84 : 13 : = valueLateralStateRightRssStateInformationCurrentDistance; 85 : 13 : ::ad::rss::state::RssStateEvaluator valueLateralStateRightRssStateInformationEvaluator( 86 : : ::ad::rss::state::RssStateEvaluator::None); 87 : 13 : valueLateralStateRightRssStateInformation.evaluator = valueLateralStateRightRssStateInformationEvaluator; 88 : 13 : valueLateralStateRight.rssStateInformation = valueLateralStateRightRssStateInformation; 89 : 13 : value.lateralStateRight = valueLateralStateRight; 90 : 13 : ::ad::rss::state::LateralRssState valueLateralStateLeft; 91 : 13 : bool valueLateralStateLeftIsSafe{true}; 92 : 13 : valueLateralStateLeft.isSafe = valueLateralStateLeftIsSafe; 93 : 13 : ::ad::rss::state::LateralResponse valueLateralStateLeftResponse(::ad::rss::state::LateralResponse::None); 94 : 13 : valueLateralStateLeft.response = valueLateralStateLeftResponse; 95 : 13 : ::ad::rss::world::LateralRssAccelerationValues valueLateralStateLeftAlphaLat; 96 : 13 : ::ad::physics::Acceleration valueLateralStateLeftAlphaLatAccelMax(-1e2); 97 : 13 : valueLateralStateLeftAlphaLatAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct 98 : 13 : valueLateralStateLeftAlphaLat.accelMax = valueLateralStateLeftAlphaLatAccelMax; 99 : 13 : ::ad::physics::Acceleration valueLateralStateLeftAlphaLatBrakeMin(-1e2); 100 : 13 : valueLateralStateLeftAlphaLat.brakeMin = valueLateralStateLeftAlphaLatBrakeMin; 101 : 13 : valueLateralStateLeft.alphaLat = valueLateralStateLeftAlphaLat; 102 : 13 : ::ad::rss::state::RssStateInformation valueLateralStateLeftRssStateInformation; 103 : 13 : ::ad::physics::Distance valueLateralStateLeftRssStateInformationSafeDistance(-1e9); 104 : 13 : valueLateralStateLeftRssStateInformation.safeDistance = valueLateralStateLeftRssStateInformationSafeDistance; 105 : 13 : ::ad::physics::Distance valueLateralStateLeftRssStateInformationCurrentDistance(-1e9); 106 : 13 : valueLateralStateLeftRssStateInformation.currentDistance = valueLateralStateLeftRssStateInformationCurrentDistance; 107 : 13 : ::ad::rss::state::RssStateEvaluator valueLateralStateLeftRssStateInformationEvaluator( 108 : : ::ad::rss::state::RssStateEvaluator::None); 109 : 13 : valueLateralStateLeftRssStateInformation.evaluator = valueLateralStateLeftRssStateInformationEvaluator; 110 : 13 : valueLateralStateLeft.rssStateInformation = valueLateralStateLeftRssStateInformation; 111 : 13 : value.lateralStateLeft = valueLateralStateLeft; 112 : 26 : ::ad::rss::state::UnstructuredSceneRssState valueUnstructuredSceneState; 113 : 13 : bool valueUnstructuredSceneStateIsSafe{true}; 114 : 13 : valueUnstructuredSceneState.isSafe = valueUnstructuredSceneStateIsSafe; 115 : 13 : ::ad::rss::state::UnstructuredSceneResponse valueUnstructuredSceneStateResponse( 116 : : ::ad::rss::state::UnstructuredSceneResponse::None); 117 : 13 : valueUnstructuredSceneState.response = valueUnstructuredSceneStateResponse; 118 : 13 : ::ad::rss::state::HeadingRange valueUnstructuredSceneStateHeadingRange; 119 : 13 : ::ad::physics::Angle valueUnstructuredSceneStateHeadingRangeBegin(-6.283185308); 120 : 13 : valueUnstructuredSceneStateHeadingRange.begin = valueUnstructuredSceneStateHeadingRangeBegin; 121 : 13 : ::ad::physics::Angle valueUnstructuredSceneStateHeadingRangeEnd(-6.283185308); 122 : 13 : valueUnstructuredSceneStateHeadingRange.end = valueUnstructuredSceneStateHeadingRangeEnd; 123 : 13 : valueUnstructuredSceneState.headingRange = valueUnstructuredSceneStateHeadingRange; 124 : 26 : ::ad::rss::state::UnstructuredSceneStateInformation valueUnstructuredSceneStateRssStateInformation; 125 : 26 : ::ad::physics::Distance2DList valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySet; 126 : 13 : ::ad::physics::Distance2D valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySetElement; 127 : 13 : ::ad::physics::Distance valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySetElementX(-1e9); 128 : : valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySetElement.x 129 : 13 : = valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySetElementX; 130 : 13 : ::ad::physics::Distance valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySetElementY(-1e9); 131 : : valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySetElement.y 132 : 13 : = valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySetElementY; 133 [ + - ]: 13 : valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySet.resize( 134 : : 1, valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySetElement); 135 : : valueUnstructuredSceneStateRssStateInformation.brakeTrajectorySet 136 [ + - ]: 13 : = valueUnstructuredSceneStateRssStateInformationBrakeTrajectorySet; 137 : 26 : ::ad::physics::Distance2DList valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySet; 138 : 13 : ::ad::physics::Distance2D valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElement; 139 : 13 : ::ad::physics::Distance valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElementX(-1e9); 140 : : valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElement.x 141 : 13 : = valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElementX; 142 : 13 : ::ad::physics::Distance valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElementY(-1e9); 143 : : valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElement.y 144 : 13 : = valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElementY; 145 [ + - ]: 13 : valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySet.resize( 146 : : 1, valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElement); 147 : : valueUnstructuredSceneStateRssStateInformation.continueForwardTrajectorySet 148 [ + - ]: 13 : = valueUnstructuredSceneStateRssStateInformationContinueForwardTrajectorySet; 149 [ + - ]: 13 : valueUnstructuredSceneState.rssStateInformation = valueUnstructuredSceneStateRssStateInformation; 150 : 13 : ::ad::rss::world::LongitudinalRssAccelerationValues valueUnstructuredSceneStateAlphaLon; 151 : 13 : ::ad::physics::Acceleration valueUnstructuredSceneStateAlphaLonAccelMax(-1e2); 152 : 13 : valueUnstructuredSceneStateAlphaLonAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct 153 : 13 : valueUnstructuredSceneStateAlphaLon.accelMax = valueUnstructuredSceneStateAlphaLonAccelMax; 154 : 13 : ::ad::physics::Acceleration valueUnstructuredSceneStateAlphaLonBrakeMax(-1e2); 155 : 13 : valueUnstructuredSceneStateAlphaLon.brakeMax = valueUnstructuredSceneStateAlphaLonBrakeMax; 156 : 13 : ::ad::physics::Acceleration valueUnstructuredSceneStateAlphaLonBrakeMin(-1e2); 157 : 13 : valueUnstructuredSceneStateAlphaLon.brakeMin = valueUnstructuredSceneStateAlphaLonBrakeMin; 158 : 13 : ::ad::physics::Acceleration valueUnstructuredSceneStateAlphaLonBrakeMinCorrect(-1e2); 159 : 13 : valueUnstructuredSceneStateAlphaLon.brakeMinCorrect = valueUnstructuredSceneStateAlphaLonBrakeMinCorrect; 160 : 13 : valueUnstructuredSceneStateAlphaLon.brakeMin = valueUnstructuredSceneStateAlphaLon.brakeMax; 161 : 13 : valueUnstructuredSceneStateAlphaLon.brakeMinCorrect = valueUnstructuredSceneStateAlphaLon.brakeMin; 162 : 13 : valueUnstructuredSceneStateAlphaLon.brakeMin = valueUnstructuredSceneStateAlphaLon.brakeMinCorrect; 163 : 13 : valueUnstructuredSceneStateAlphaLon.brakeMax = valueUnstructuredSceneStateAlphaLon.brakeMin; 164 : 13 : valueUnstructuredSceneState.alphaLon = valueUnstructuredSceneStateAlphaLon; 165 [ + - ]: 13 : value.unstructuredSceneState = valueUnstructuredSceneState; 166 : 13 : ::ad::rss::situation::SituationType valueSituationType(::ad::rss::situation::SituationType::NotRelevant); 167 : 13 : value.situationType = valueSituationType; 168 [ + - ]: 13 : mValue = value; 169 : 13 : } 170 : : 171 : : ::ad::rss::state::RssState mValue; 172 : : }; 173 : : 174 : 2 : TEST_F(RssStateTests, copyConstruction) 175 : : { 176 [ + - ]: 2 : ::ad::rss::state::RssState value(mValue); 177 [ + - - + : 1 : EXPECT_EQ(mValue, value); - - - - - - ] 178 : 1 : } 179 : : 180 : 2 : TEST_F(RssStateTests, moveConstruction) 181 : : { 182 [ + - ]: 2 : ::ad::rss::state::RssState tmpValue(mValue); 183 : 2 : ::ad::rss::state::RssState value(std::move(tmpValue)); 184 [ + - - + : 1 : EXPECT_EQ(mValue, value); - - - - - - ] 185 : 1 : } 186 : : 187 : 2 : TEST_F(RssStateTests, copyAssignment) 188 : : { 189 : 2 : ::ad::rss::state::RssState value; 190 [ + - ]: 1 : value = mValue; 191 [ + - - + : 1 : EXPECT_EQ(mValue, value); - - - - - - ] 192 : 1 : } 193 : : 194 : 2 : TEST_F(RssStateTests, moveAssignment) 195 : : { 196 [ + - ]: 2 : ::ad::rss::state::RssState tmpValue(mValue); 197 : 2 : ::ad::rss::state::RssState value; 198 : 1 : value = std::move(tmpValue); 199 [ + - - + : 1 : EXPECT_EQ(mValue, value); - - - - - - ] 200 : 1 : } 201 : : 202 : 2 : TEST_F(RssStateTests, comparisonOperatorEqual) 203 : : { 204 [ + - ]: 2 : ::ad::rss::state::RssState valueA = mValue; 205 [ + - ]: 2 : ::ad::rss::state::RssState valueB = mValue; 206 : : 207 [ + - - + : 1 : EXPECT_TRUE(valueA == valueB); - - - - - - - - ] 208 [ + - - + : 1 : EXPECT_FALSE(valueA != valueB); - - - - - - - - ] 209 : 1 : } 210 : : 211 : 2 : TEST_F(RssStateTests, stringConversionTest) 212 : : { 213 [ + - ]: 1 : std::stringstream stream; 214 [ + - ]: 1 : stream << mValue; 215 [ + - ]: 1 : std::string ostreamStr = stream.str(); 216 [ + - ]: 1 : std::string toStr = std::to_string(mValue); 217 [ + - - + : 1 : ASSERT_EQ(ostreamStr, toStr); - - - - - - ] 218 : : } 219 : : 220 : 2 : TEST_F(RssStateTests, comparisonOperatorObjectIdDiffers) 221 : : { 222 [ + - ]: 2 : ::ad::rss::state::RssState valueA = mValue; 223 : 1 : ::ad::rss::world::ObjectId objectId(std::numeric_limits<::ad::rss::world::ObjectId>::max()); 224 : 1 : valueA.objectId = objectId; 225 [ + - ]: 2 : ::ad::rss::state::RssState valueB = mValue; 226 : : 227 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 228 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 229 : 1 : } 230 : : 231 : 2 : TEST_F(RssStateTests, comparisonOperatorSituationIdDiffers) 232 : : { 233 [ + - ]: 2 : ::ad::rss::state::RssState valueA = mValue; 234 : 1 : ::ad::rss::situation::SituationId situationId(std::numeric_limits<::ad::rss::situation::SituationId>::max()); 235 : 1 : valueA.situationId = situationId; 236 [ + - ]: 2 : ::ad::rss::state::RssState valueB = mValue; 237 : : 238 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 239 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 240 : 1 : } 241 : : 242 : 2 : TEST_F(RssStateTests, comparisonOperatorLongitudinalStateDiffers) 243 : : { 244 [ + - ]: 2 : ::ad::rss::state::RssState valueA = mValue; 245 : 1 : ::ad::rss::state::LongitudinalRssState longitudinalState; 246 : 1 : bool longitudinalStateIsSafe{false}; 247 : 1 : longitudinalState.isSafe = longitudinalStateIsSafe; 248 : 1 : ::ad::rss::state::LongitudinalResponse longitudinalStateResponse(::ad::rss::state::LongitudinalResponse::BrakeMin); 249 : 1 : longitudinalState.response = longitudinalStateResponse; 250 : 1 : ::ad::rss::world::LongitudinalRssAccelerationValues longitudinalStateAlphaLon; 251 : 1 : ::ad::physics::Acceleration longitudinalStateAlphaLonAccelMax(1e2); 252 : 1 : longitudinalStateAlphaLon.accelMax = longitudinalStateAlphaLonAccelMax; 253 : 1 : ::ad::physics::Acceleration longitudinalStateAlphaLonBrakeMax(1e2); 254 : 1 : longitudinalStateAlphaLon.brakeMax = longitudinalStateAlphaLonBrakeMax; 255 : 1 : ::ad::physics::Acceleration longitudinalStateAlphaLonBrakeMin(1e2); 256 : 1 : longitudinalStateAlphaLon.brakeMin = longitudinalStateAlphaLonBrakeMin; 257 : 1 : ::ad::physics::Acceleration longitudinalStateAlphaLonBrakeMinCorrect(1e2); 258 : 1 : longitudinalStateAlphaLonBrakeMinCorrect = ::ad::physics::Acceleration(0. * 0.9); // set to valid value within struct 259 : 1 : longitudinalStateAlphaLon.brakeMinCorrect = longitudinalStateAlphaLonBrakeMinCorrect; 260 : 1 : longitudinalStateAlphaLon.brakeMinCorrect = longitudinalStateAlphaLon.brakeMin; 261 : 1 : longitudinalStateAlphaLon.brakeMin = longitudinalStateAlphaLon.brakeMax; 262 : 1 : longitudinalStateAlphaLon.brakeMax = longitudinalStateAlphaLon.brakeMin; 263 : 1 : longitudinalStateAlphaLon.brakeMin = longitudinalStateAlphaLon.brakeMinCorrect; 264 : 1 : longitudinalState.alphaLon = longitudinalStateAlphaLon; 265 : 1 : ::ad::rss::state::RssStateInformation longitudinalStateRssStateInformation; 266 : 1 : ::ad::physics::Distance longitudinalStateRssStateInformationSafeDistance(1e9); 267 : 1 : longitudinalStateRssStateInformation.safeDistance = longitudinalStateRssStateInformationSafeDistance; 268 : 1 : ::ad::physics::Distance longitudinalStateRssStateInformationCurrentDistance(1e9); 269 : 1 : longitudinalStateRssStateInformation.currentDistance = longitudinalStateRssStateInformationCurrentDistance; 270 : 1 : ::ad::rss::state::RssStateEvaluator longitudinalStateRssStateInformationEvaluator( 271 : : ::ad::rss::state::RssStateEvaluator::IntersectionOverlap); 272 : 1 : longitudinalStateRssStateInformation.evaluator = longitudinalStateRssStateInformationEvaluator; 273 : 1 : longitudinalState.rssStateInformation = longitudinalStateRssStateInformation; 274 : 1 : valueA.longitudinalState = longitudinalState; 275 [ + - ]: 2 : ::ad::rss::state::RssState valueB = mValue; 276 : : 277 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 278 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 279 : 1 : } 280 : : 281 : 2 : TEST_F(RssStateTests, comparisonOperatorLateralStateRightDiffers) 282 : : { 283 [ + - ]: 2 : ::ad::rss::state::RssState valueA = mValue; 284 : 1 : ::ad::rss::state::LateralRssState lateralStateRight; 285 : 1 : bool lateralStateRightIsSafe{false}; 286 : 1 : lateralStateRight.isSafe = lateralStateRightIsSafe; 287 : 1 : ::ad::rss::state::LateralResponse lateralStateRightResponse(::ad::rss::state::LateralResponse::BrakeMin); 288 : 1 : lateralStateRight.response = lateralStateRightResponse; 289 : 1 : ::ad::rss::world::LateralRssAccelerationValues lateralStateRightAlphaLat; 290 : 1 : ::ad::physics::Acceleration lateralStateRightAlphaLatAccelMax(1e2); 291 : 1 : lateralStateRightAlphaLat.accelMax = lateralStateRightAlphaLatAccelMax; 292 : 1 : ::ad::physics::Acceleration lateralStateRightAlphaLatBrakeMin(1e2); 293 : 1 : lateralStateRightAlphaLatBrakeMin = ::ad::physics::Acceleration(0. * 0.9); // set to valid value within struct 294 : 1 : lateralStateRightAlphaLat.brakeMin = lateralStateRightAlphaLatBrakeMin; 295 : 1 : lateralStateRight.alphaLat = lateralStateRightAlphaLat; 296 : 1 : ::ad::rss::state::RssStateInformation lateralStateRightRssStateInformation; 297 : 1 : ::ad::physics::Distance lateralStateRightRssStateInformationSafeDistance(1e9); 298 : 1 : lateralStateRightRssStateInformation.safeDistance = lateralStateRightRssStateInformationSafeDistance; 299 : 1 : ::ad::physics::Distance lateralStateRightRssStateInformationCurrentDistance(1e9); 300 : 1 : lateralStateRightRssStateInformation.currentDistance = lateralStateRightRssStateInformationCurrentDistance; 301 : 1 : ::ad::rss::state::RssStateEvaluator lateralStateRightRssStateInformationEvaluator( 302 : : ::ad::rss::state::RssStateEvaluator::IntersectionOverlap); 303 : 1 : lateralStateRightRssStateInformation.evaluator = lateralStateRightRssStateInformationEvaluator; 304 : 1 : lateralStateRight.rssStateInformation = lateralStateRightRssStateInformation; 305 : 1 : valueA.lateralStateRight = lateralStateRight; 306 [ + - ]: 2 : ::ad::rss::state::RssState valueB = mValue; 307 : : 308 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 309 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 310 : 1 : } 311 : : 312 : 2 : TEST_F(RssStateTests, comparisonOperatorLateralStateLeftDiffers) 313 : : { 314 [ + - ]: 2 : ::ad::rss::state::RssState valueA = mValue; 315 : 1 : ::ad::rss::state::LateralRssState lateralStateLeft; 316 : 1 : bool lateralStateLeftIsSafe{false}; 317 : 1 : lateralStateLeft.isSafe = lateralStateLeftIsSafe; 318 : 1 : ::ad::rss::state::LateralResponse lateralStateLeftResponse(::ad::rss::state::LateralResponse::BrakeMin); 319 : 1 : lateralStateLeft.response = lateralStateLeftResponse; 320 : 1 : ::ad::rss::world::LateralRssAccelerationValues lateralStateLeftAlphaLat; 321 : 1 : ::ad::physics::Acceleration lateralStateLeftAlphaLatAccelMax(1e2); 322 : 1 : lateralStateLeftAlphaLat.accelMax = lateralStateLeftAlphaLatAccelMax; 323 : 1 : ::ad::physics::Acceleration lateralStateLeftAlphaLatBrakeMin(1e2); 324 : 1 : lateralStateLeftAlphaLatBrakeMin = ::ad::physics::Acceleration(0. * 0.9); // set to valid value within struct 325 : 1 : lateralStateLeftAlphaLat.brakeMin = lateralStateLeftAlphaLatBrakeMin; 326 : 1 : lateralStateLeft.alphaLat = lateralStateLeftAlphaLat; 327 : 1 : ::ad::rss::state::RssStateInformation lateralStateLeftRssStateInformation; 328 : 1 : ::ad::physics::Distance lateralStateLeftRssStateInformationSafeDistance(1e9); 329 : 1 : lateralStateLeftRssStateInformation.safeDistance = lateralStateLeftRssStateInformationSafeDistance; 330 : 1 : ::ad::physics::Distance lateralStateLeftRssStateInformationCurrentDistance(1e9); 331 : 1 : lateralStateLeftRssStateInformation.currentDistance = lateralStateLeftRssStateInformationCurrentDistance; 332 : 1 : ::ad::rss::state::RssStateEvaluator lateralStateLeftRssStateInformationEvaluator( 333 : : ::ad::rss::state::RssStateEvaluator::IntersectionOverlap); 334 : 1 : lateralStateLeftRssStateInformation.evaluator = lateralStateLeftRssStateInformationEvaluator; 335 : 1 : lateralStateLeft.rssStateInformation = lateralStateLeftRssStateInformation; 336 : 1 : valueA.lateralStateLeft = lateralStateLeft; 337 [ + - ]: 2 : ::ad::rss::state::RssState valueB = mValue; 338 : : 339 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 340 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 341 : 1 : } 342 : : 343 : 2 : TEST_F(RssStateTests, comparisonOperatorUnstructuredSceneStateDiffers) 344 : : { 345 [ + - ]: 2 : ::ad::rss::state::RssState valueA = mValue; 346 : 2 : ::ad::rss::state::UnstructuredSceneRssState unstructuredSceneState; 347 : 1 : bool unstructuredSceneStateIsSafe{false}; 348 : 1 : unstructuredSceneState.isSafe = unstructuredSceneStateIsSafe; 349 : 1 : ::ad::rss::state::UnstructuredSceneResponse unstructuredSceneStateResponse( 350 : : ::ad::rss::state::UnstructuredSceneResponse::Brake); 351 : 1 : unstructuredSceneState.response = unstructuredSceneStateResponse; 352 : 1 : ::ad::rss::state::HeadingRange unstructuredSceneStateHeadingRange; 353 : 1 : ::ad::physics::Angle unstructuredSceneStateHeadingRangeBegin(6.283185308); 354 : 1 : unstructuredSceneStateHeadingRange.begin = unstructuredSceneStateHeadingRangeBegin; 355 : 1 : ::ad::physics::Angle unstructuredSceneStateHeadingRangeEnd(6.283185308); 356 : 1 : unstructuredSceneStateHeadingRange.end = unstructuredSceneStateHeadingRangeEnd; 357 : 1 : unstructuredSceneState.headingRange = unstructuredSceneStateHeadingRange; 358 : 2 : ::ad::rss::state::UnstructuredSceneStateInformation unstructuredSceneStateRssStateInformation; 359 : 2 : ::ad::physics::Distance2DList unstructuredSceneStateRssStateInformationBrakeTrajectorySet; 360 : 1 : ::ad::physics::Distance2D unstructuredSceneStateRssStateInformationBrakeTrajectorySetElement; 361 : 1 : ::ad::physics::Distance unstructuredSceneStateRssStateInformationBrakeTrajectorySetElementX(1e9); 362 : : unstructuredSceneStateRssStateInformationBrakeTrajectorySetElement.x 363 : 1 : = unstructuredSceneStateRssStateInformationBrakeTrajectorySetElementX; 364 : 1 : ::ad::physics::Distance unstructuredSceneStateRssStateInformationBrakeTrajectorySetElementY(1e9); 365 : : unstructuredSceneStateRssStateInformationBrakeTrajectorySetElement.y 366 : 1 : = unstructuredSceneStateRssStateInformationBrakeTrajectorySetElementY; 367 [ + - ]: 1 : unstructuredSceneStateRssStateInformationBrakeTrajectorySet.resize( 368 : : 2, unstructuredSceneStateRssStateInformationBrakeTrajectorySetElement); 369 : : unstructuredSceneStateRssStateInformation.brakeTrajectorySet 370 [ + - ]: 1 : = unstructuredSceneStateRssStateInformationBrakeTrajectorySet; 371 : 2 : ::ad::physics::Distance2DList unstructuredSceneStateRssStateInformationContinueForwardTrajectorySet; 372 : 1 : ::ad::physics::Distance2D unstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElement; 373 : 1 : ::ad::physics::Distance unstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElementX(1e9); 374 : : unstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElement.x 375 : 1 : = unstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElementX; 376 : 1 : ::ad::physics::Distance unstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElementY(1e9); 377 : : unstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElement.y 378 : 1 : = unstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElementY; 379 [ + - ]: 1 : unstructuredSceneStateRssStateInformationContinueForwardTrajectorySet.resize( 380 : : 2, unstructuredSceneStateRssStateInformationContinueForwardTrajectorySetElement); 381 : : unstructuredSceneStateRssStateInformation.continueForwardTrajectorySet 382 [ + - ]: 1 : = unstructuredSceneStateRssStateInformationContinueForwardTrajectorySet; 383 [ + - ]: 1 : unstructuredSceneState.rssStateInformation = unstructuredSceneStateRssStateInformation; 384 : 1 : ::ad::rss::world::LongitudinalRssAccelerationValues unstructuredSceneStateAlphaLon; 385 : 1 : ::ad::physics::Acceleration unstructuredSceneStateAlphaLonAccelMax(1e2); 386 : 1 : unstructuredSceneStateAlphaLon.accelMax = unstructuredSceneStateAlphaLonAccelMax; 387 : 1 : ::ad::physics::Acceleration unstructuredSceneStateAlphaLonBrakeMax(1e2); 388 : 1 : unstructuredSceneStateAlphaLon.brakeMax = unstructuredSceneStateAlphaLonBrakeMax; 389 : 1 : ::ad::physics::Acceleration unstructuredSceneStateAlphaLonBrakeMin(1e2); 390 : 1 : unstructuredSceneStateAlphaLon.brakeMin = unstructuredSceneStateAlphaLonBrakeMin; 391 : 1 : ::ad::physics::Acceleration unstructuredSceneStateAlphaLonBrakeMinCorrect(1e2); 392 : : unstructuredSceneStateAlphaLonBrakeMinCorrect 393 : 1 : = ::ad::physics::Acceleration(0. * 0.9); // set to valid value within struct 394 : 1 : unstructuredSceneStateAlphaLon.brakeMinCorrect = unstructuredSceneStateAlphaLonBrakeMinCorrect; 395 : 1 : unstructuredSceneStateAlphaLon.brakeMinCorrect = unstructuredSceneStateAlphaLon.brakeMin; 396 : 1 : unstructuredSceneStateAlphaLon.brakeMin = unstructuredSceneStateAlphaLon.brakeMax; 397 : 1 : unstructuredSceneStateAlphaLon.brakeMax = unstructuredSceneStateAlphaLon.brakeMin; 398 : 1 : unstructuredSceneStateAlphaLon.brakeMin = unstructuredSceneStateAlphaLon.brakeMinCorrect; 399 : 1 : unstructuredSceneState.alphaLon = unstructuredSceneStateAlphaLon; 400 [ + - ]: 1 : valueA.unstructuredSceneState = unstructuredSceneState; 401 [ + - ]: 2 : ::ad::rss::state::RssState valueB = mValue; 402 : : 403 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 404 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 405 : 1 : } 406 : : 407 : 2 : TEST_F(RssStateTests, comparisonOperatorSituationTypeDiffers) 408 : : { 409 [ + - ]: 2 : ::ad::rss::state::RssState valueA = mValue; 410 : 1 : ::ad::rss::situation::SituationType situationType(::ad::rss::situation::SituationType::Unstructured); 411 : 1 : valueA.situationType = situationType; 412 [ + - ]: 2 : ::ad::rss::state::RssState valueB = mValue; 413 : : 414 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 415 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 416 : 1 : } 417 : : 418 : : #if defined(__clang__) && (__clang_major__ >= 7) 419 : : #pragma GCC diagnostic pop 420 : : #endif