Branch data Line data Source code
1 : : /* 2 : : * ----------------- BEGIN LICENSE BLOCK --------------------------------- 3 : : * 4 : : * Copyright (C) 2018-2021 Intel Corporation 5 : : * 6 : : * SPDX-License-Identifier: MIT 7 : : * 8 : : * ----------------- END LICENSE BLOCK ----------------------------------- 9 : : */ 10 : : 11 : : /* 12 : : * Generated file 13 : : */ 14 : : 15 : : #include <gtest/gtest.h> 16 : : 17 : : #include <limits> 18 : : 19 : : #include "ad/map/landmark/ENULandmarkValidInputRange.hpp" 20 : : 21 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRange) 22 : : { 23 : 1 : ::ad::map::landmark::ENULandmark value; 24 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 25 : 1 : value.id = valueId; 26 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 27 : 1 : value.type = valueType; 28 : 1 : ::ad::map::point::ENUPoint valuePosition; 29 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 30 : 1 : valuePosition.x = valuePositionX; 31 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 32 : 1 : valuePosition.y = valuePositionY; 33 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 34 : 1 : valuePosition.z = valuePositionZ; 35 : 1 : value.position = valuePosition; 36 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 37 : 1 : value.heading = valueHeading; 38 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 39 : 1 : value.trafficLightType = valueTrafficLightType; 40 [ + - - + : 1 : ASSERT_TRUE(withinValidInputRange(value)); - - - - - - - - ] 41 : : } 42 : : 43 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangeTypeTooSmall) 44 : : { 45 : 1 : ::ad::map::landmark::ENULandmark value; 46 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 47 : 1 : value.id = valueId; 48 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 49 : 1 : value.type = valueType; 50 : 1 : ::ad::map::point::ENUPoint valuePosition; 51 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 52 : 1 : valuePosition.x = valuePositionX; 53 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 54 : 1 : valuePosition.y = valuePositionY; 55 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 56 : 1 : valuePosition.z = valuePositionZ; 57 : 1 : value.position = valuePosition; 58 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 59 : 1 : value.heading = valueHeading; 60 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 61 : 1 : value.trafficLightType = valueTrafficLightType; 62 : : 63 : : // override member with data type value below input range minimum 64 : 1 : ::ad::map::landmark::LandmarkType invalidInitializedMember(static_cast<::ad::map::landmark::LandmarkType>(-1)); 65 : 1 : value.type = invalidInitializedMember; 66 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 67 : : } 68 : : 69 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangeTypeTooBig) 70 : : { 71 : 1 : ::ad::map::landmark::ENULandmark value; 72 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 73 : 1 : value.id = valueId; 74 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 75 : 1 : value.type = valueType; 76 : 1 : ::ad::map::point::ENUPoint valuePosition; 77 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 78 : 1 : valuePosition.x = valuePositionX; 79 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 80 : 1 : valuePosition.y = valuePositionY; 81 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 82 : 1 : valuePosition.z = valuePositionZ; 83 : 1 : value.position = valuePosition; 84 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 85 : 1 : value.heading = valueHeading; 86 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 87 : 1 : value.trafficLightType = valueTrafficLightType; 88 : : 89 : : // override member with data type value above input range maximum 90 : 1 : ::ad::map::landmark::LandmarkType invalidInitializedMember(static_cast<::ad::map::landmark::LandmarkType>(-1)); 91 : 1 : value.type = invalidInitializedMember; 92 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 93 : : } 94 : : 95 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangePositionTooSmall) 96 : : { 97 : 1 : ::ad::map::landmark::ENULandmark value; 98 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 99 : 1 : value.id = valueId; 100 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 101 : 1 : value.type = valueType; 102 : 1 : ::ad::map::point::ENUPoint valuePosition; 103 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 104 : 1 : valuePosition.x = valuePositionX; 105 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 106 : 1 : valuePosition.y = valuePositionY; 107 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 108 : 1 : valuePosition.z = valuePositionZ; 109 : 1 : value.position = valuePosition; 110 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 111 : 1 : value.heading = valueHeading; 112 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 113 : 1 : value.trafficLightType = valueTrafficLightType; 114 : : 115 : : // override member with data type value below input range minimum 116 : 1 : ::ad::map::point::ENUPoint invalidInitializedMember; 117 : 1 : ::ad::map::point::ENUCoordinate invalidInitializedMemberX(-16384 * 1.1); 118 : 1 : invalidInitializedMember.x = invalidInitializedMemberX; 119 : 1 : value.position = invalidInitializedMember; 120 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 121 : : } 122 : : 123 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangePositionTooBig) 124 : : { 125 : 1 : ::ad::map::landmark::ENULandmark value; 126 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 127 : 1 : value.id = valueId; 128 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 129 : 1 : value.type = valueType; 130 : 1 : ::ad::map::point::ENUPoint valuePosition; 131 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 132 : 1 : valuePosition.x = valuePositionX; 133 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 134 : 1 : valuePosition.y = valuePositionY; 135 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 136 : 1 : valuePosition.z = valuePositionZ; 137 : 1 : value.position = valuePosition; 138 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 139 : 1 : value.heading = valueHeading; 140 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 141 : 1 : value.trafficLightType = valueTrafficLightType; 142 : : 143 : : // override member with data type value above input range maximum 144 : 1 : ::ad::map::point::ENUPoint invalidInitializedMember; 145 : 1 : ::ad::map::point::ENUCoordinate invalidInitializedMemberX(16384 * 1.1); 146 : 1 : invalidInitializedMember.x = invalidInitializedMemberX; 147 : 1 : value.position = invalidInitializedMember; 148 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 149 : : } 150 : : 151 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangeHeadingTooSmall) 152 : : { 153 : 1 : ::ad::map::landmark::ENULandmark value; 154 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 155 : 1 : value.id = valueId; 156 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 157 : 1 : value.type = valueType; 158 : 1 : ::ad::map::point::ENUPoint valuePosition; 159 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 160 : 1 : valuePosition.x = valuePositionX; 161 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 162 : 1 : valuePosition.y = valuePositionY; 163 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 164 : 1 : valuePosition.z = valuePositionZ; 165 : 1 : value.position = valuePosition; 166 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 167 : 1 : value.heading = valueHeading; 168 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 169 : 1 : value.trafficLightType = valueTrafficLightType; 170 : : 171 : : // override member with data type value below input range minimum 172 : 1 : ::ad::map::point::ENUHeading invalidInitializedMember(-3.141592655 * 1.1); 173 : 1 : value.heading = invalidInitializedMember; 174 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 175 : : } 176 : : 177 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangeHeadingTooBig) 178 : : { 179 : 1 : ::ad::map::landmark::ENULandmark value; 180 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 181 : 1 : value.id = valueId; 182 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 183 : 1 : value.type = valueType; 184 : 1 : ::ad::map::point::ENUPoint valuePosition; 185 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 186 : 1 : valuePosition.x = valuePositionX; 187 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 188 : 1 : valuePosition.y = valuePositionY; 189 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 190 : 1 : valuePosition.z = valuePositionZ; 191 : 1 : value.position = valuePosition; 192 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 193 : 1 : value.heading = valueHeading; 194 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 195 : 1 : value.trafficLightType = valueTrafficLightType; 196 : : 197 : : // override member with data type value above input range maximum 198 : 1 : ::ad::map::point::ENUHeading invalidInitializedMember(3.141592655 * 1.1); 199 : 1 : value.heading = invalidInitializedMember; 200 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 201 : : } 202 : : 203 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangeheadingDefault) 204 : : { 205 : 1 : ::ad::map::landmark::ENULandmark value; 206 : 1 : ::ad::map::point::ENUHeading valueDefault; 207 : 1 : value.heading = valueDefault; 208 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 209 : : } 210 : : 211 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangeTrafficLightTypeTooSmall) 212 : : { 213 : 1 : ::ad::map::landmark::ENULandmark value; 214 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 215 : 1 : value.id = valueId; 216 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 217 : 1 : value.type = valueType; 218 : 1 : ::ad::map::point::ENUPoint valuePosition; 219 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 220 : 1 : valuePosition.x = valuePositionX; 221 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 222 : 1 : valuePosition.y = valuePositionY; 223 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 224 : 1 : valuePosition.z = valuePositionZ; 225 : 1 : value.position = valuePosition; 226 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 227 : 1 : value.heading = valueHeading; 228 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 229 : 1 : value.trafficLightType = valueTrafficLightType; 230 : : 231 : : // override member with data type value below input range minimum 232 : 1 : ::ad::map::landmark::TrafficLightType invalidInitializedMember( 233 : : static_cast<::ad::map::landmark::TrafficLightType>(-1)); 234 : 1 : value.trafficLightType = invalidInitializedMember; 235 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 236 : : } 237 : : 238 : 2 : TEST(ENULandmarkValidInputRangeTests, testValidInputRangeTrafficLightTypeTooBig) 239 : : { 240 : 1 : ::ad::map::landmark::ENULandmark value; 241 : 1 : ::ad::map::landmark::LandmarkId valueId(std::numeric_limits<::ad::map::landmark::LandmarkId>::lowest()); 242 : 1 : value.id = valueId; 243 : 1 : ::ad::map::landmark::LandmarkType valueType(::ad::map::landmark::LandmarkType::INVALID); 244 : 1 : value.type = valueType; 245 : 1 : ::ad::map::point::ENUPoint valuePosition; 246 : 1 : ::ad::map::point::ENUCoordinate valuePositionX(-16384); 247 : 1 : valuePosition.x = valuePositionX; 248 : 1 : ::ad::map::point::ENUCoordinate valuePositionY(-16384); 249 : 1 : valuePosition.y = valuePositionY; 250 : 1 : ::ad::map::point::ENUCoordinate valuePositionZ(-16384); 251 : 1 : valuePosition.z = valuePositionZ; 252 : 1 : value.position = valuePosition; 253 : 1 : ::ad::map::point::ENUHeading valueHeading(-3.141592655); 254 : 1 : value.heading = valueHeading; 255 : 1 : ::ad::map::landmark::TrafficLightType valueTrafficLightType(::ad::map::landmark::TrafficLightType::INVALID); 256 : 1 : value.trafficLightType = valueTrafficLightType; 257 : : 258 : : // override member with data type value above input range maximum 259 : 1 : ::ad::map::landmark::TrafficLightType invalidInitializedMember( 260 : : static_cast<::ad::map::landmark::TrafficLightType>(-1)); 261 : 1 : value.trafficLightType = invalidInitializedMember; 262 [ + - - + : 1 : ASSERT_FALSE(withinValidInputRange(value)); - - - - - - - - ] 263 : : }