LCOV - code coverage report
Current view: top level - tests/generated/ad/rss/world - VelocityValidInputRangeTests.cpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 183 183 100.0 %
Date: 2024-10-01 15:08:14 Functions: 26 26 100.0 %
Branches: 28 168 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: 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/VelocityValidInputRange.hpp"
      20                 :            : 
      21                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRange)
      22                 :            : {
      23                 :          1 :   ::ad::rss::world::Velocity value;
      24                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
      25                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
      26                 :          1 :   value.speedLonMin = valueSpeedLonMin;
      27                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
      28                 :          1 :   value.speedLonMax = valueSpeedLonMax;
      29                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
      30                 :          1 :   value.speedLatMin = valueSpeedLatMin;
      31                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
      32                 :          1 :   value.speedLatMax = valueSpeedLatMax;
      33                 :          1 :   value.speedLonMax = value.speedLonMin;
      34                 :          1 :   value.speedLatMax = value.speedLatMin;
      35                 :          1 :   value.speedLonMin = value.speedLonMax;
      36                 :          1 :   value.speedLatMin = value.speedLatMax;
      37   [ +  -  -  +  :          1 :   ASSERT_TRUE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      38                 :            : }
      39                 :            : 
      40                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangeSpeedLonMinTooSmall)
      41                 :            : {
      42                 :          1 :   ::ad::rss::world::Velocity value;
      43                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
      44                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
      45                 :          1 :   value.speedLonMin = valueSpeedLonMin;
      46                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
      47                 :          1 :   value.speedLonMax = valueSpeedLonMax;
      48                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
      49                 :          1 :   value.speedLatMin = valueSpeedLatMin;
      50                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
      51                 :          1 :   value.speedLatMax = valueSpeedLatMax;
      52                 :          1 :   value.speedLonMax = value.speedLonMin;
      53                 :          1 :   value.speedLatMax = value.speedLatMin;
      54                 :          1 :   value.speedLonMin = value.speedLonMax;
      55                 :          1 :   value.speedLatMin = value.speedLatMax;
      56                 :            : 
      57                 :            :   // override member with data type value below input range minimum
      58                 :          1 :   ::ad::physics::Speed invalidInitializedMember(-100. * 1.1);
      59                 :          1 :   value.speedLonMin = invalidInitializedMember;
      60   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      61                 :            : 
      62                 :            :   // override member with value below struct member input range minimum
      63                 :            :   invalidInitializedMember
      64                 :          1 :     = ::ad::physics::Speed(0. - ::ad::physics::Speed::cPrecisionValue); // set to invalid value within struct
      65                 :          1 :   value.speedLonMin = invalidInitializedMember;
      66   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      67                 :            : }
      68                 :            : 
      69                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangeSpeedLonMinTooBig)
      70                 :            : {
      71                 :          1 :   ::ad::rss::world::Velocity value;
      72                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
      73                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
      74                 :          1 :   value.speedLonMin = valueSpeedLonMin;
      75                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
      76                 :          1 :   value.speedLonMax = valueSpeedLonMax;
      77                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
      78                 :          1 :   value.speedLatMin = valueSpeedLatMin;
      79                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
      80                 :          1 :   value.speedLatMax = valueSpeedLatMax;
      81                 :          1 :   value.speedLonMax = value.speedLonMin;
      82                 :          1 :   value.speedLatMax = value.speedLatMin;
      83                 :          1 :   value.speedLonMin = value.speedLonMax;
      84                 :          1 :   value.speedLatMin = value.speedLatMax;
      85                 :            : 
      86                 :            :   // override member with data type value above input range maximum
      87                 :          1 :   ::ad::physics::Speed invalidInitializedMember(100. * 1.1);
      88                 :          1 :   value.speedLonMin = invalidInitializedMember;
      89   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      90                 :            : }
      91                 :            : 
      92                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangespeedLonMinDefault)
      93                 :            : {
      94                 :          1 :   ::ad::rss::world::Velocity value;
      95                 :          1 :   ::ad::physics::Speed valueDefault;
      96                 :          1 :   value.speedLonMin = valueDefault;
      97   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      98                 :            : }
      99                 :            : 
     100                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangeSpeedLonMaxTooSmall)
     101                 :            : {
     102                 :          1 :   ::ad::rss::world::Velocity value;
     103                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
     104                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
     105                 :          1 :   value.speedLonMin = valueSpeedLonMin;
     106                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
     107                 :          1 :   value.speedLonMax = valueSpeedLonMax;
     108                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
     109                 :          1 :   value.speedLatMin = valueSpeedLatMin;
     110                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
     111                 :          1 :   value.speedLatMax = valueSpeedLatMax;
     112                 :          1 :   value.speedLonMax = value.speedLonMin;
     113                 :          1 :   value.speedLatMax = value.speedLatMin;
     114                 :          1 :   value.speedLonMin = value.speedLonMax;
     115                 :          1 :   value.speedLatMin = value.speedLatMax;
     116                 :            : 
     117                 :            :   // override member with data type value below input range minimum
     118                 :          1 :   ::ad::physics::Speed invalidInitializedMember(-100. * 1.1);
     119                 :          1 :   value.speedLonMax = invalidInitializedMember;
     120   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     121                 :            : }
     122                 :            : 
     123                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangeSpeedLonMaxTooBig)
     124                 :            : {
     125                 :          1 :   ::ad::rss::world::Velocity value;
     126                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
     127                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
     128                 :          1 :   value.speedLonMin = valueSpeedLonMin;
     129                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
     130                 :          1 :   value.speedLonMax = valueSpeedLonMax;
     131                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
     132                 :          1 :   value.speedLatMin = valueSpeedLatMin;
     133                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
     134                 :          1 :   value.speedLatMax = valueSpeedLatMax;
     135                 :          1 :   value.speedLonMax = value.speedLonMin;
     136                 :          1 :   value.speedLatMax = value.speedLatMin;
     137                 :          1 :   value.speedLonMin = value.speedLonMax;
     138                 :          1 :   value.speedLatMin = value.speedLatMax;
     139                 :            : 
     140                 :            :   // override member with data type value above input range maximum
     141                 :          1 :   ::ad::physics::Speed invalidInitializedMember(100. * 1.1);
     142                 :          1 :   value.speedLonMax = invalidInitializedMember;
     143   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     144                 :            : }
     145                 :            : 
     146                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangespeedLonMaxDefault)
     147                 :            : {
     148                 :          1 :   ::ad::rss::world::Velocity value;
     149                 :          1 :   ::ad::physics::Speed valueDefault;
     150                 :          1 :   value.speedLonMax = valueDefault;
     151   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     152                 :            : }
     153                 :            : 
     154                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangeSpeedLatMinTooSmall)
     155                 :            : {
     156                 :          1 :   ::ad::rss::world::Velocity value;
     157                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
     158                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
     159                 :          1 :   value.speedLonMin = valueSpeedLonMin;
     160                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
     161                 :          1 :   value.speedLonMax = valueSpeedLonMax;
     162                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
     163                 :          1 :   value.speedLatMin = valueSpeedLatMin;
     164                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
     165                 :          1 :   value.speedLatMax = valueSpeedLatMax;
     166                 :          1 :   value.speedLonMax = value.speedLonMin;
     167                 :          1 :   value.speedLatMax = value.speedLatMin;
     168                 :          1 :   value.speedLonMin = value.speedLonMax;
     169                 :          1 :   value.speedLatMin = value.speedLatMax;
     170                 :            : 
     171                 :            :   // override member with data type value below input range minimum
     172                 :          1 :   ::ad::physics::Speed invalidInitializedMember(-100. * 1.1);
     173                 :          1 :   value.speedLatMin = invalidInitializedMember;
     174   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     175                 :            : }
     176                 :            : 
     177                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangeSpeedLatMinTooBig)
     178                 :            : {
     179                 :          1 :   ::ad::rss::world::Velocity value;
     180                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
     181                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
     182                 :          1 :   value.speedLonMin = valueSpeedLonMin;
     183                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
     184                 :          1 :   value.speedLonMax = valueSpeedLonMax;
     185                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
     186                 :          1 :   value.speedLatMin = valueSpeedLatMin;
     187                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
     188                 :          1 :   value.speedLatMax = valueSpeedLatMax;
     189                 :          1 :   value.speedLonMax = value.speedLonMin;
     190                 :          1 :   value.speedLatMax = value.speedLatMin;
     191                 :          1 :   value.speedLonMin = value.speedLonMax;
     192                 :          1 :   value.speedLatMin = value.speedLatMax;
     193                 :            : 
     194                 :            :   // override member with data type value above input range maximum
     195                 :          1 :   ::ad::physics::Speed invalidInitializedMember(100. * 1.1);
     196                 :          1 :   value.speedLatMin = invalidInitializedMember;
     197   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     198                 :            : }
     199                 :            : 
     200                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangespeedLatMinDefault)
     201                 :            : {
     202                 :          1 :   ::ad::rss::world::Velocity value;
     203                 :          1 :   ::ad::physics::Speed valueDefault;
     204                 :          1 :   value.speedLatMin = valueDefault;
     205   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     206                 :            : }
     207                 :            : 
     208                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangeSpeedLatMaxTooSmall)
     209                 :            : {
     210                 :          1 :   ::ad::rss::world::Velocity value;
     211                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
     212                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
     213                 :          1 :   value.speedLonMin = valueSpeedLonMin;
     214                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
     215                 :          1 :   value.speedLonMax = valueSpeedLonMax;
     216                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
     217                 :          1 :   value.speedLatMin = valueSpeedLatMin;
     218                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
     219                 :          1 :   value.speedLatMax = valueSpeedLatMax;
     220                 :          1 :   value.speedLonMax = value.speedLonMin;
     221                 :          1 :   value.speedLatMax = value.speedLatMin;
     222                 :          1 :   value.speedLonMin = value.speedLonMax;
     223                 :          1 :   value.speedLatMin = value.speedLatMax;
     224                 :            : 
     225                 :            :   // override member with data type value below input range minimum
     226                 :          1 :   ::ad::physics::Speed invalidInitializedMember(-100. * 1.1);
     227                 :          1 :   value.speedLatMax = invalidInitializedMember;
     228   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     229                 :            : }
     230                 :            : 
     231                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangeSpeedLatMaxTooBig)
     232                 :            : {
     233                 :          1 :   ::ad::rss::world::Velocity value;
     234                 :          1 :   ::ad::physics::Speed valueSpeedLonMin(-100.);
     235                 :          1 :   valueSpeedLonMin = ::ad::physics::Speed(0.); // set to valid value within struct
     236                 :          1 :   value.speedLonMin = valueSpeedLonMin;
     237                 :          1 :   ::ad::physics::Speed valueSpeedLonMax(-100.);
     238                 :          1 :   value.speedLonMax = valueSpeedLonMax;
     239                 :          1 :   ::ad::physics::Speed valueSpeedLatMin(-100.);
     240                 :          1 :   value.speedLatMin = valueSpeedLatMin;
     241                 :          1 :   ::ad::physics::Speed valueSpeedLatMax(-100.);
     242                 :          1 :   value.speedLatMax = valueSpeedLatMax;
     243                 :          1 :   value.speedLonMax = value.speedLonMin;
     244                 :          1 :   value.speedLatMax = value.speedLatMin;
     245                 :          1 :   value.speedLonMin = value.speedLonMax;
     246                 :          1 :   value.speedLatMin = value.speedLatMax;
     247                 :            : 
     248                 :            :   // override member with data type value above input range maximum
     249                 :          1 :   ::ad::physics::Speed invalidInitializedMember(100. * 1.1);
     250                 :          1 :   value.speedLatMax = invalidInitializedMember;
     251   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     252                 :            : }
     253                 :            : 
     254                 :          2 : TEST(VelocityValidInputRangeTests, testValidInputRangespeedLatMaxDefault)
     255                 :            : {
     256                 :          1 :   ::ad::rss::world::Velocity value;
     257                 :          1 :   ::ad::physics::Speed valueDefault;
     258                 :          1 :   value.speedLatMax = valueDefault;
     259   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     260                 :            : }

Generated by: LCOV version 1.14