LCOV - code coverage report
Current view: top level - tests/generated/ad/rss/world - LaneSegmentVectorValidInputRangeTests.cpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 132 132 100.0 %
Date: 2025-07-22 06:53:46 Functions: 21 21 100.0 %
Branches: 34 124 27.4 %

           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                 :            : #include <gtest/gtest.h>
      16                 :            : 
      17                 :            : #include <limits>
      18                 :            : 
      19                 :            : #include "ad/rss/world/LaneSegmentVectorValidInputRange.hpp"
      20                 :            : 
      21                 :          4 : TEST(LaneSegmentVectorValidInputRangeTests, testValidInputRangeLowerThanInputRangeMin)
      22                 :            : {
      23                 :          1 :   ::ad::rss::world::LaneSegmentVector value;
      24   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
             -  -  -  +  
                      - ]
      25         [ +  - ]:          1 : }
      26                 :            : 
      27                 :          4 : TEST(LaneSegmentVectorValidInputRangeTests, testValidInputRangeValidInputRangeMin)
      28                 :            : {
      29                 :          1 :   ::ad::rss::world::LaneSegmentVector value;
      30                 :          1 :   ::ad::rss::world::LaneSegment element;
      31                 :          1 :   ::ad::rss::world::LaneSegmentId elementId(std::numeric_limits<::ad::rss::world::LaneSegmentId>::lowest());
      32                 :          1 :   element.id = elementId;
      33                 :          1 :   ::ad::rss::world::LaneDrivingDirection elementDriving_direction(
      34                 :            :     ::ad::rss::world::LaneDrivingDirection::Bidirectional);
      35                 :          1 :   element.driving_direction = elementDriving_direction;
      36                 :          1 :   ::ad::physics::MetricRange elementLength;
      37                 :          1 :   ::ad::physics::Distance elementLengthMinimum(-1e9);
      38                 :          1 :   elementLengthMinimum = ::ad::physics::Distance(0.); // set to valid value within struct
      39                 :          1 :   elementLength.minimum = elementLengthMinimum;
      40                 :          1 :   ::ad::physics::Distance elementLengthMaximum(-1e9);
      41                 :          1 :   elementLength.maximum = elementLengthMaximum;
      42                 :          1 :   elementLength.maximum = elementLength.minimum;
      43                 :          1 :   elementLength.minimum = elementLength.maximum;
      44                 :          1 :   element.length = elementLength;
      45                 :          1 :   ::ad::physics::MetricRange elementWidth;
      46                 :          1 :   ::ad::physics::Distance elementWidthMinimum(-1e9);
      47                 :          1 :   elementWidthMinimum = ::ad::physics::Distance(0.); // set to valid value within struct
      48                 :          1 :   elementWidth.minimum = elementWidthMinimum;
      49                 :          1 :   ::ad::physics::Distance elementWidthMaximum(-1e9);
      50                 :          1 :   elementWidth.maximum = elementWidthMaximum;
      51                 :          1 :   elementWidth.maximum = elementWidth.minimum;
      52                 :          1 :   elementWidth.minimum = elementWidth.maximum;
      53                 :          1 :   element.width = elementWidth;
      54         [ +  - ]:          1 :   value.resize(1, element);
      55   [ +  -  -  +  :          1 :   ASSERT_TRUE(withinValidInputRange(value));
          -  -  -  -  -  
             -  -  -  +  
                      - ]
      56         [ +  - ]:          1 : }
      57                 :            : 
      58                 :          4 : TEST(LaneSegmentVectorValidInputRangeTests, testValidInputRangeValidInputRangeMax)
      59                 :            : {
      60                 :          1 :   ::ad::rss::world::LaneSegmentVector value;
      61                 :          1 :   ::ad::rss::world::LaneSegment element;
      62                 :          1 :   ::ad::rss::world::LaneSegmentId elementId(std::numeric_limits<::ad::rss::world::LaneSegmentId>::lowest());
      63                 :          1 :   element.id = elementId;
      64                 :          1 :   ::ad::rss::world::LaneDrivingDirection elementDriving_direction(
      65                 :            :     ::ad::rss::world::LaneDrivingDirection::Bidirectional);
      66                 :          1 :   element.driving_direction = elementDriving_direction;
      67                 :          1 :   ::ad::physics::MetricRange elementLength;
      68                 :          1 :   ::ad::physics::Distance elementLengthMinimum(-1e9);
      69                 :          1 :   elementLengthMinimum = ::ad::physics::Distance(0.); // set to valid value within struct
      70                 :          1 :   elementLength.minimum = elementLengthMinimum;
      71                 :          1 :   ::ad::physics::Distance elementLengthMaximum(-1e9);
      72                 :          1 :   elementLength.maximum = elementLengthMaximum;
      73                 :          1 :   elementLength.maximum = elementLength.minimum;
      74                 :          1 :   elementLength.minimum = elementLength.maximum;
      75                 :          1 :   element.length = elementLength;
      76                 :          1 :   ::ad::physics::MetricRange elementWidth;
      77                 :          1 :   ::ad::physics::Distance elementWidthMinimum(-1e9);
      78                 :          1 :   elementWidthMinimum = ::ad::physics::Distance(0.); // set to valid value within struct
      79                 :          1 :   elementWidth.minimum = elementWidthMinimum;
      80                 :          1 :   ::ad::physics::Distance elementWidthMaximum(-1e9);
      81                 :          1 :   elementWidth.maximum = elementWidthMaximum;
      82                 :          1 :   elementWidth.maximum = elementWidth.minimum;
      83                 :          1 :   elementWidth.minimum = elementWidth.maximum;
      84                 :          1 :   element.width = elementWidth;
      85         [ +  - ]:          1 :   value.resize(20, element);
      86   [ +  -  -  +  :          1 :   ASSERT_TRUE(withinValidInputRange(value));
          -  -  -  -  -  
             -  -  -  +  
                      - ]
      87         [ +  - ]:          1 : }
      88                 :            : 
      89                 :          4 : TEST(LaneSegmentVectorValidInputRangeTests, testValidInputRangeHigherThanInputRangeMax)
      90                 :            : {
      91                 :          1 :   ::ad::rss::world::LaneSegmentVector value;
      92                 :          1 :   ::ad::rss::world::LaneSegment element;
      93                 :          1 :   ::ad::rss::world::LaneSegmentId elementId(std::numeric_limits<::ad::rss::world::LaneSegmentId>::lowest());
      94                 :          1 :   element.id = elementId;
      95                 :          1 :   ::ad::rss::world::LaneDrivingDirection elementDriving_direction(
      96                 :            :     ::ad::rss::world::LaneDrivingDirection::Bidirectional);
      97                 :          1 :   element.driving_direction = elementDriving_direction;
      98                 :          1 :   ::ad::physics::MetricRange elementLength;
      99                 :          1 :   ::ad::physics::Distance elementLengthMinimum(-1e9);
     100                 :          1 :   elementLengthMinimum = ::ad::physics::Distance(0.); // set to valid value within struct
     101                 :          1 :   elementLength.minimum = elementLengthMinimum;
     102                 :          1 :   ::ad::physics::Distance elementLengthMaximum(-1e9);
     103                 :          1 :   elementLength.maximum = elementLengthMaximum;
     104                 :          1 :   elementLength.maximum = elementLength.minimum;
     105                 :          1 :   elementLength.minimum = elementLength.maximum;
     106                 :          1 :   element.length = elementLength;
     107                 :          1 :   ::ad::physics::MetricRange elementWidth;
     108                 :          1 :   ::ad::physics::Distance elementWidthMinimum(-1e9);
     109                 :          1 :   elementWidthMinimum = ::ad::physics::Distance(0.); // set to valid value within struct
     110                 :          1 :   elementWidth.minimum = elementWidthMinimum;
     111                 :          1 :   ::ad::physics::Distance elementWidthMaximum(-1e9);
     112                 :          1 :   elementWidth.maximum = elementWidthMaximum;
     113                 :          1 :   elementWidth.maximum = elementWidth.minimum;
     114                 :          1 :   elementWidth.minimum = elementWidth.maximum;
     115                 :          1 :   element.width = elementWidth;
     116         [ +  - ]:          1 :   value.resize(21, element);
     117   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
             -  -  -  +  
                      - ]
     118         [ +  - ]:          1 : }
     119                 :            : 
     120                 :          4 : TEST(LaneSegmentVectorValidInputRangeTests, testValidInputRangeElementTypeInvalid)
     121                 :            : {
     122                 :          1 :   ::ad::rss::world::LaneSegmentVector value;
     123                 :          1 :   ::ad::rss::world::LaneSegment element;
     124                 :          1 :   ::ad::rss::world::LaneDrivingDirection elementDriving_direction(
     125                 :            :     static_cast<::ad::rss::world::LaneDrivingDirection>(-1));
     126                 :          1 :   element.driving_direction = elementDriving_direction;
     127         [ +  - ]:          1 :   value.resize(1, element);
     128   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
             -  -  -  +  
                      - ]
     129         [ +  - ]:          1 : }
     130                 :            : 
     131                 :          4 : TEST(LaneSegmentVectorValidInputRangeTests, testValidInputRangeElementValid)
     132                 :            : {
     133                 :          1 :   ::ad::rss::world::LaneSegmentVector value;
     134                 :          1 :   ::ad::rss::world::LaneSegment element;
     135                 :          1 :   ::ad::rss::world::LaneSegmentId elementId(std::numeric_limits<::ad::rss::world::LaneSegmentId>::lowest());
     136                 :          1 :   element.id = elementId;
     137                 :          1 :   ::ad::rss::world::LaneDrivingDirection elementDriving_direction(
     138                 :            :     ::ad::rss::world::LaneDrivingDirection::Bidirectional);
     139                 :          1 :   element.driving_direction = elementDriving_direction;
     140                 :          1 :   ::ad::physics::MetricRange elementLength;
     141                 :          1 :   ::ad::physics::Distance elementLengthMinimum(-1e9);
     142                 :          1 :   elementLengthMinimum = ::ad::physics::Distance(0.); // set to valid value within struct
     143                 :          1 :   elementLength.minimum = elementLengthMinimum;
     144                 :          1 :   ::ad::physics::Distance elementLengthMaximum(-1e9);
     145                 :          1 :   elementLength.maximum = elementLengthMaximum;
     146                 :          1 :   elementLength.maximum = elementLength.minimum;
     147                 :          1 :   elementLength.minimum = elementLength.maximum;
     148                 :          1 :   element.length = elementLength;
     149                 :          1 :   ::ad::physics::MetricRange elementWidth;
     150                 :          1 :   ::ad::physics::Distance elementWidthMinimum(-1e9);
     151                 :          1 :   elementWidthMinimum = ::ad::physics::Distance(0.); // set to valid value within struct
     152                 :          1 :   elementWidth.minimum = elementWidthMinimum;
     153                 :          1 :   ::ad::physics::Distance elementWidthMaximum(-1e9);
     154                 :          1 :   elementWidth.maximum = elementWidthMaximum;
     155                 :          1 :   elementWidth.maximum = elementWidth.minimum;
     156                 :          1 :   elementWidth.minimum = elementWidth.maximum;
     157                 :          1 :   element.width = elementWidth;
     158         [ +  - ]:          1 :   value.push_back(element);
     159   [ +  -  -  +  :          1 :   ASSERT_TRUE(withinValidInputRange(value));
          -  -  -  -  -  
             -  -  -  +  
                      - ]
     160         [ +  - ]:          1 : }
     161                 :            : 
     162                 :          4 : TEST(LaneSegmentVectorValidInputRangeTests, testValidInputRangeElementInvalid)
     163                 :            : {
     164                 :          1 :   ::ad::rss::world::LaneSegmentVector value;
     165                 :          1 :   ::ad::rss::world::LaneSegment element;
     166                 :          1 :   ::ad::rss::world::LaneDrivingDirection elementDriving_direction(
     167                 :            :     static_cast<::ad::rss::world::LaneDrivingDirection>(-1));
     168                 :          1 :   element.driving_direction = elementDriving_direction;
     169         [ +  - ]:          1 :   value.push_back(element);
     170   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
             -  -  -  +  
                      - ]
     171         [ +  - ]:          1 : }

Generated by: LCOV version 1.14