Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2022 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/UnstructuredConstellationStateInformation.hpp" 23 : : 24 : : class UnstructuredConstellationStateInformationTests : public testing::Test 25 : : { 26 : : protected: 27 : 9 : virtual void SetUp() override 28 : : { 29 : : // valid initialization 30 : 9 : ::ad::rss::state::UnstructuredConstellationStateInformation value; 31 : 9 : ::ad::physics::Distance2DList valueBrake_trajectory_set; 32 : 9 : ::ad::physics::Distance2D valueBrake_trajectory_setElement; 33 : 9 : ::ad::physics::Distance valueBrake_trajectory_setElementX(-1e9); 34 : 9 : valueBrake_trajectory_setElement.x = valueBrake_trajectory_setElementX; 35 : 9 : ::ad::physics::Distance valueBrake_trajectory_setElementY(-1e9); 36 : 9 : valueBrake_trajectory_setElement.y = valueBrake_trajectory_setElementY; 37 [ + - ]: 9 : valueBrake_trajectory_set.resize(1, valueBrake_trajectory_setElement); 38 [ + - ]: 9 : value.brake_trajectory_set = valueBrake_trajectory_set; 39 : 9 : ::ad::physics::Distance2DList valueContinue_forward_trajectory_set; 40 : 9 : ::ad::physics::Distance2D valueContinue_forward_trajectory_setElement; 41 : 9 : ::ad::physics::Distance valueContinue_forward_trajectory_setElementX(-1e9); 42 : 9 : valueContinue_forward_trajectory_setElement.x = valueContinue_forward_trajectory_setElementX; 43 : 9 : ::ad::physics::Distance valueContinue_forward_trajectory_setElementY(-1e9); 44 : 9 : valueContinue_forward_trajectory_setElement.y = valueContinue_forward_trajectory_setElementY; 45 [ + - ]: 9 : valueContinue_forward_trajectory_set.resize(1, valueContinue_forward_trajectory_setElement); 46 [ + - ]: 9 : value.continue_forward_trajectory_set = valueContinue_forward_trajectory_set; 47 : 9 : ::ad::physics::Angle valueConsidered_drive_away_steering_angle(-6.283185308); 48 : 9 : value.considered_drive_away_steering_angle = valueConsidered_drive_away_steering_angle; 49 [ + - ]: 9 : mValue = value; 50 : 9 : } 51 : : 52 : : ::ad::rss::state::UnstructuredConstellationStateInformation mValue; 53 : : }; 54 : : 55 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, copyConstruction) 56 : : { 57 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation value(mValue); 58 [ + - - + : 1 : EXPECT_EQ(mValue, value); - - - - - - ] 59 : 1 : } 60 : : 61 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, moveConstruction) 62 : : { 63 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation tmpValue(mValue); 64 : 1 : ::ad::rss::state::UnstructuredConstellationStateInformation value(std::move(tmpValue)); 65 [ + - - + : 1 : EXPECT_EQ(mValue, value); - - - - - - ] 66 : 1 : } 67 : : 68 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, copyAssignment) 69 : : { 70 : 1 : ::ad::rss::state::UnstructuredConstellationStateInformation value; 71 [ + - ]: 1 : value = mValue; 72 [ + - - + : 1 : EXPECT_EQ(mValue, value); - - - - - - ] 73 : 1 : } 74 : : 75 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, moveAssignment) 76 : : { 77 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation tmpValue(mValue); 78 : 1 : ::ad::rss::state::UnstructuredConstellationStateInformation value; 79 : 1 : value = std::move(tmpValue); 80 [ + - - + : 1 : EXPECT_EQ(mValue, value); - - - - - - ] 81 : 1 : } 82 : : 83 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, comparisonOperatorEqual) 84 : : { 85 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation valueA = mValue; 86 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation valueB = mValue; 87 : : 88 [ + - - + : 1 : EXPECT_TRUE(valueA == valueB); - - - - - - - - ] 89 [ + - - + : 1 : EXPECT_FALSE(valueA != valueB); - - - - - - - - ] 90 : 1 : } 91 : : 92 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, stringConversionTest) 93 : : { 94 [ + - ]: 1 : std::stringstream stream; 95 [ + - ]: 1 : stream << mValue; 96 [ + - ]: 1 : std::string ostreamStr = stream.str(); 97 [ + - ]: 1 : std::string toStr = std::to_string(mValue); 98 [ + - - + : 1 : ASSERT_EQ(ostreamStr, toStr); - - - - - - + - ] 99 [ + - + - : 1 : } + - ] 100 : : 101 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, comparisonOperatorBrake_trajectory_setDiffers) 102 : : { 103 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation valueA = mValue; 104 : 1 : ::ad::physics::Distance2DList brake_trajectory_set; 105 : 1 : ::ad::physics::Distance2D brake_trajectory_setElement; 106 : 1 : ::ad::physics::Distance brake_trajectory_setElementX(1e9); 107 : 1 : brake_trajectory_setElement.x = brake_trajectory_setElementX; 108 : 1 : ::ad::physics::Distance brake_trajectory_setElementY(1e9); 109 : 1 : brake_trajectory_setElement.y = brake_trajectory_setElementY; 110 [ + - ]: 1 : brake_trajectory_set.resize(2, brake_trajectory_setElement); 111 [ + - ]: 1 : valueA.brake_trajectory_set = brake_trajectory_set; 112 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation valueB = mValue; 113 : : 114 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 115 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 116 : 1 : } 117 : : 118 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, comparisonOperatorContinue_forward_trajectory_setDiffers) 119 : : { 120 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation valueA = mValue; 121 : 1 : ::ad::physics::Distance2DList continue_forward_trajectory_set; 122 : 1 : ::ad::physics::Distance2D continue_forward_trajectory_setElement; 123 : 1 : ::ad::physics::Distance continue_forward_trajectory_setElementX(1e9); 124 : 1 : continue_forward_trajectory_setElement.x = continue_forward_trajectory_setElementX; 125 : 1 : ::ad::physics::Distance continue_forward_trajectory_setElementY(1e9); 126 : 1 : continue_forward_trajectory_setElement.y = continue_forward_trajectory_setElementY; 127 [ + - ]: 1 : continue_forward_trajectory_set.resize(2, continue_forward_trajectory_setElement); 128 [ + - ]: 1 : valueA.continue_forward_trajectory_set = continue_forward_trajectory_set; 129 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation valueB = mValue; 130 : : 131 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 132 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 133 : 1 : } 134 : : 135 : 4 : TEST_F(UnstructuredConstellationStateInformationTests, comparisonOperatorConsidered_drive_away_steering_angleDiffers) 136 : : { 137 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation valueA = mValue; 138 : 1 : ::ad::physics::Angle considered_drive_away_steering_angle(6.283185308); 139 : 1 : valueA.considered_drive_away_steering_angle = considered_drive_away_steering_angle; 140 [ + - ]: 1 : ::ad::rss::state::UnstructuredConstellationStateInformation valueB = mValue; 141 : : 142 [ + - - + : 1 : EXPECT_FALSE(valueA == valueB); - - - - - - - - ] 143 [ + - - + : 1 : EXPECT_TRUE(valueA != valueB); - - - - - - - - ] 144 : 1 : } 145 : : 146 : : #if defined(__clang__) && (__clang_major__ >= 7) 147 : : #pragma GCC diagnostic pop 148 : : #endif