LCOV - code coverage report
Current view: top level - tests/generated/ad/map/restriction - VehicleDescriptorValidInputRangeTests.cpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 205 205 100.0 %
Date: 2022-10-04 09:48:07 Functions: 30 30 100.0 %
Branches: 30 180 16.7 %

           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/restriction/VehicleDescriptorValidInputRange.hpp"
      20                 :            : 
      21                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRange)
      22                 :            : {
      23                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
      24                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
      25                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
      26                 :          1 :   value.passengers = valuePassengers;
      27                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
      28                 :          1 :   value.type = valueType;
      29                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
      30                 :          1 :   value.width = valueWidth;
      31                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
      32                 :          1 :   value.height = valueHeight;
      33                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
      34                 :          1 :   value.length = valueLength;
      35                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
      36                 :          1 :   value.weight = valueWeight;
      37   [ +  -  -  +  :          1 :   ASSERT_TRUE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      38                 :            : }
      39                 :            : 
      40                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeTypeTooSmall)
      41                 :            : {
      42                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
      43                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
      44                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
      45                 :          1 :   value.passengers = valuePassengers;
      46                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
      47                 :          1 :   value.type = valueType;
      48                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
      49                 :          1 :   value.width = valueWidth;
      50                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
      51                 :          1 :   value.height = valueHeight;
      52                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
      53                 :          1 :   value.length = valueLength;
      54                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
      55                 :          1 :   value.weight = valueWeight;
      56                 :            : 
      57                 :            :   // override member with data type value below input range minimum
      58                 :          1 :   ::ad::map::restriction::RoadUserType invalidInitializedMember(static_cast<::ad::map::restriction::RoadUserType>(-1));
      59                 :          1 :   value.type = invalidInitializedMember;
      60   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      61                 :            : }
      62                 :            : 
      63                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeTypeTooBig)
      64                 :            : {
      65                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
      66                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
      67                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
      68                 :          1 :   value.passengers = valuePassengers;
      69                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
      70                 :          1 :   value.type = valueType;
      71                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
      72                 :          1 :   value.width = valueWidth;
      73                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
      74                 :          1 :   value.height = valueHeight;
      75                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
      76                 :          1 :   value.length = valueLength;
      77                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
      78                 :          1 :   value.weight = valueWeight;
      79                 :            : 
      80                 :            :   // override member with data type value above input range maximum
      81                 :          1 :   ::ad::map::restriction::RoadUserType invalidInitializedMember(static_cast<::ad::map::restriction::RoadUserType>(-1));
      82                 :          1 :   value.type = invalidInitializedMember;
      83   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      84                 :            : }
      85                 :            : 
      86                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeWidthTooSmall)
      87                 :            : {
      88                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
      89                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
      90                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
      91                 :          1 :   value.passengers = valuePassengers;
      92                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
      93                 :          1 :   value.type = valueType;
      94                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
      95                 :          1 :   value.width = valueWidth;
      96                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
      97                 :          1 :   value.height = valueHeight;
      98                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
      99                 :          1 :   value.length = valueLength;
     100                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
     101                 :          1 :   value.weight = valueWeight;
     102                 :            : 
     103                 :            :   // override member with data type value below input range minimum
     104                 :          1 :   ::ad::physics::Distance invalidInitializedMember(-1e9 * 1.1);
     105                 :          1 :   value.width = invalidInitializedMember;
     106   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     107                 :            : }
     108                 :            : 
     109                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeWidthTooBig)
     110                 :            : {
     111                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     112                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
     113                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
     114                 :          1 :   value.passengers = valuePassengers;
     115                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
     116                 :          1 :   value.type = valueType;
     117                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
     118                 :          1 :   value.width = valueWidth;
     119                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
     120                 :          1 :   value.height = valueHeight;
     121                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
     122                 :          1 :   value.length = valueLength;
     123                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
     124                 :          1 :   value.weight = valueWeight;
     125                 :            : 
     126                 :            :   // override member with data type value above input range maximum
     127                 :          1 :   ::ad::physics::Distance invalidInitializedMember(1e9 * 1.1);
     128                 :          1 :   value.width = invalidInitializedMember;
     129   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     130                 :            : }
     131                 :            : 
     132                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangewidthDefault)
     133                 :            : {
     134                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     135                 :          1 :   ::ad::physics::Distance valueDefault;
     136                 :          1 :   value.width = valueDefault;
     137   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     138                 :            : }
     139                 :            : 
     140                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeHeightTooSmall)
     141                 :            : {
     142                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     143                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
     144                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
     145                 :          1 :   value.passengers = valuePassengers;
     146                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
     147                 :          1 :   value.type = valueType;
     148                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
     149                 :          1 :   value.width = valueWidth;
     150                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
     151                 :          1 :   value.height = valueHeight;
     152                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
     153                 :          1 :   value.length = valueLength;
     154                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
     155                 :          1 :   value.weight = valueWeight;
     156                 :            : 
     157                 :            :   // override member with data type value below input range minimum
     158                 :          1 :   ::ad::physics::Distance invalidInitializedMember(-1e9 * 1.1);
     159                 :          1 :   value.height = invalidInitializedMember;
     160   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     161                 :            : }
     162                 :            : 
     163                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeHeightTooBig)
     164                 :            : {
     165                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     166                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
     167                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
     168                 :          1 :   value.passengers = valuePassengers;
     169                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
     170                 :          1 :   value.type = valueType;
     171                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
     172                 :          1 :   value.width = valueWidth;
     173                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
     174                 :          1 :   value.height = valueHeight;
     175                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
     176                 :          1 :   value.length = valueLength;
     177                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
     178                 :          1 :   value.weight = valueWeight;
     179                 :            : 
     180                 :            :   // override member with data type value above input range maximum
     181                 :          1 :   ::ad::physics::Distance invalidInitializedMember(1e9 * 1.1);
     182                 :          1 :   value.height = invalidInitializedMember;
     183   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     184                 :            : }
     185                 :            : 
     186                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeheightDefault)
     187                 :            : {
     188                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     189                 :          1 :   ::ad::physics::Distance valueDefault;
     190                 :          1 :   value.height = valueDefault;
     191   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     192                 :            : }
     193                 :            : 
     194                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeLengthTooSmall)
     195                 :            : {
     196                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     197                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
     198                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
     199                 :          1 :   value.passengers = valuePassengers;
     200                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
     201                 :          1 :   value.type = valueType;
     202                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
     203                 :          1 :   value.width = valueWidth;
     204                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
     205                 :          1 :   value.height = valueHeight;
     206                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
     207                 :          1 :   value.length = valueLength;
     208                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
     209                 :          1 :   value.weight = valueWeight;
     210                 :            : 
     211                 :            :   // override member with data type value below input range minimum
     212                 :          1 :   ::ad::physics::Distance invalidInitializedMember(-1e9 * 1.1);
     213                 :          1 :   value.length = invalidInitializedMember;
     214   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     215                 :            : }
     216                 :            : 
     217                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeLengthTooBig)
     218                 :            : {
     219                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     220                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
     221                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
     222                 :          1 :   value.passengers = valuePassengers;
     223                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
     224                 :          1 :   value.type = valueType;
     225                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
     226                 :          1 :   value.width = valueWidth;
     227                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
     228                 :          1 :   value.height = valueHeight;
     229                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
     230                 :          1 :   value.length = valueLength;
     231                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
     232                 :          1 :   value.weight = valueWeight;
     233                 :            : 
     234                 :            :   // override member with data type value above input range maximum
     235                 :          1 :   ::ad::physics::Distance invalidInitializedMember(1e9 * 1.1);
     236                 :          1 :   value.length = invalidInitializedMember;
     237   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     238                 :            : }
     239                 :            : 
     240                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangelengthDefault)
     241                 :            : {
     242                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     243                 :          1 :   ::ad::physics::Distance valueDefault;
     244                 :          1 :   value.length = valueDefault;
     245   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     246                 :            : }
     247                 :            : 
     248                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeWeightTooSmall)
     249                 :            : {
     250                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     251                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
     252                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
     253                 :          1 :   value.passengers = valuePassengers;
     254                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
     255                 :          1 :   value.type = valueType;
     256                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
     257                 :          1 :   value.width = valueWidth;
     258                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
     259                 :          1 :   value.height = valueHeight;
     260                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
     261                 :          1 :   value.length = valueLength;
     262                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
     263                 :          1 :   value.weight = valueWeight;
     264                 :            : 
     265                 :            :   // override member with data type value below input range minimum
     266                 :          1 :   ::ad::physics::Weight invalidInitializedMember{}; // TODO: not invalid
     267                 :          1 :   value.weight = invalidInitializedMember;
     268   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     269                 :            : }
     270                 :            : 
     271                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeWeightTooBig)
     272                 :            : {
     273                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     274                 :          1 :   ::ad::map::restriction::PassengerCount valuePassengers(
     275                 :            :     std::numeric_limits<::ad::map::restriction::PassengerCount>::lowest());
     276                 :          1 :   value.passengers = valuePassengers;
     277                 :          1 :   ::ad::map::restriction::RoadUserType valueType(::ad::map::restriction::RoadUserType::INVALID);
     278                 :          1 :   value.type = valueType;
     279                 :          1 :   ::ad::physics::Distance valueWidth(-1e9);
     280                 :          1 :   value.width = valueWidth;
     281                 :          1 :   ::ad::physics::Distance valueHeight(-1e9);
     282                 :          1 :   value.height = valueHeight;
     283                 :          1 :   ::ad::physics::Distance valueLength(-1e9);
     284                 :          1 :   value.length = valueLength;
     285                 :          1 :   ::ad::physics::Weight valueWeight(std::numeric_limits<::ad::physics::Weight>::lowest());
     286                 :          1 :   value.weight = valueWeight;
     287                 :            : 
     288                 :            :   // override member with data type value above input range maximum
     289                 :          1 :   ::ad::physics::Weight invalidInitializedMember(48600.0 * 1.1);
     290                 :          1 :   value.weight = invalidInitializedMember;
     291   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     292                 :            : }
     293                 :            : 
     294                 :          2 : TEST(VehicleDescriptorValidInputRangeTests, testValidInputRangeweightDefault)
     295                 :            : {
     296                 :          1 :   ::ad::map::restriction::VehicleDescriptor value;
     297                 :          1 :   ::ad::physics::Weight valueDefault;
     298                 :          1 :   value.weight = valueDefault;
     299   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     300                 :            : }

Generated by: LCOV version 1.14