LCOV - code coverage report
Current view: top level - tests/generated/ad/rss/world - LateralRssAccelerationValuesValidInputRangeTests.cpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 65 65 100.0 %
Date: 2024-04-23 14:35:54 Functions: 14 14 100.0 %
Branches: 18 108 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/LateralRssAccelerationValuesValidInputRange.hpp"
      20                 :            : 
      21                 :          2 : TEST(LateralRssAccelerationValuesValidInputRangeTests, testValidInputRange)
      22                 :            : {
      23                 :          1 :   ::ad::rss::world::LateralRssAccelerationValues value;
      24                 :          1 :   ::ad::physics::Acceleration valueAccelMax(-1e2);
      25                 :          1 :   valueAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct
      26                 :          1 :   value.accelMax = valueAccelMax;
      27                 :          1 :   ::ad::physics::Acceleration valueBrakeMin(-1e2);
      28                 :          1 :   value.brakeMin = valueBrakeMin;
      29   [ +  -  -  +  :          1 :   ASSERT_TRUE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      30                 :            : }
      31                 :            : 
      32                 :          2 : TEST(LateralRssAccelerationValuesValidInputRangeTests, testValidInputRangeAccelMaxTooSmall)
      33                 :            : {
      34                 :          1 :   ::ad::rss::world::LateralRssAccelerationValues value;
      35                 :          1 :   ::ad::physics::Acceleration valueAccelMax(-1e2);
      36                 :          1 :   valueAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct
      37                 :          1 :   value.accelMax = valueAccelMax;
      38                 :          1 :   ::ad::physics::Acceleration valueBrakeMin(-1e2);
      39                 :          1 :   value.brakeMin = valueBrakeMin;
      40                 :            : 
      41                 :            :   // override member with data type value below input range minimum
      42                 :          1 :   ::ad::physics::Acceleration invalidInitializedMember(-1e2 * 1.1);
      43                 :          1 :   value.accelMax = invalidInitializedMember;
      44   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      45                 :            : 
      46                 :            :   // override member with value below struct member input range minimum
      47                 :          2 :   invalidInitializedMember = ::ad::physics::Acceleration(
      48                 :          1 :     0. - ::ad::physics::Acceleration::cPrecisionValue); // set to invalid value within struct
      49                 :          1 :   value.accelMax = invalidInitializedMember;
      50   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      51                 :            : }
      52                 :            : 
      53                 :          2 : TEST(LateralRssAccelerationValuesValidInputRangeTests, testValidInputRangeAccelMaxTooBig)
      54                 :            : {
      55                 :          1 :   ::ad::rss::world::LateralRssAccelerationValues value;
      56                 :          1 :   ::ad::physics::Acceleration valueAccelMax(-1e2);
      57                 :          1 :   valueAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct
      58                 :          1 :   value.accelMax = valueAccelMax;
      59                 :          1 :   ::ad::physics::Acceleration valueBrakeMin(-1e2);
      60                 :          1 :   value.brakeMin = valueBrakeMin;
      61                 :            : 
      62                 :            :   // override member with data type value above input range maximum
      63                 :          1 :   ::ad::physics::Acceleration invalidInitializedMember(1e2 * 1.1);
      64                 :          1 :   value.accelMax = invalidInitializedMember;
      65   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      66                 :            : }
      67                 :            : 
      68                 :          2 : TEST(LateralRssAccelerationValuesValidInputRangeTests, testValidInputRangeaccelMaxDefault)
      69                 :            : {
      70                 :          1 :   ::ad::rss::world::LateralRssAccelerationValues value;
      71                 :          1 :   ::ad::physics::Acceleration valueDefault;
      72                 :          1 :   value.accelMax = valueDefault;
      73   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      74                 :            : }
      75                 :            : 
      76                 :          2 : TEST(LateralRssAccelerationValuesValidInputRangeTests, testValidInputRangeBrakeMinTooSmall)
      77                 :            : {
      78                 :          1 :   ::ad::rss::world::LateralRssAccelerationValues value;
      79                 :          1 :   ::ad::physics::Acceleration valueAccelMax(-1e2);
      80                 :          1 :   valueAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct
      81                 :          1 :   value.accelMax = valueAccelMax;
      82                 :          1 :   ::ad::physics::Acceleration valueBrakeMin(-1e2);
      83                 :          1 :   value.brakeMin = valueBrakeMin;
      84                 :            : 
      85                 :            :   // override member with data type value below input range minimum
      86                 :          1 :   ::ad::physics::Acceleration invalidInitializedMember(-1e2 * 1.1);
      87                 :          1 :   value.brakeMin = invalidInitializedMember;
      88   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
      89                 :            : }
      90                 :            : 
      91                 :          2 : TEST(LateralRssAccelerationValuesValidInputRangeTests, testValidInputRangeBrakeMinTooBig)
      92                 :            : {
      93                 :          1 :   ::ad::rss::world::LateralRssAccelerationValues value;
      94                 :          1 :   ::ad::physics::Acceleration valueAccelMax(-1e2);
      95                 :          1 :   valueAccelMax = ::ad::physics::Acceleration(0.); // set to valid value within struct
      96                 :          1 :   value.accelMax = valueAccelMax;
      97                 :          1 :   ::ad::physics::Acceleration valueBrakeMin(-1e2);
      98                 :          1 :   value.brakeMin = valueBrakeMin;
      99                 :            : 
     100                 :            :   // override member with data type value above input range maximum
     101                 :          1 :   ::ad::physics::Acceleration invalidInitializedMember(1e2 * 1.1);
     102                 :          1 :   value.brakeMin = invalidInitializedMember;
     103   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     104                 :            : 
     105                 :            :   // override member with value above struct member input range maximum
     106                 :          1 :   invalidInitializedMember = ::ad::physics::Acceleration(0.); // set to valid value within struct
     107                 :          1 :   value.brakeMin = invalidInitializedMember;
     108   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     109                 :            : }
     110                 :            : 
     111                 :          2 : TEST(LateralRssAccelerationValuesValidInputRangeTests, testValidInputRangebrakeMinDefault)
     112                 :            : {
     113                 :          1 :   ::ad::rss::world::LateralRssAccelerationValues value;
     114                 :          1 :   ::ad::physics::Acceleration valueDefault;
     115                 :          1 :   value.brakeMin = valueDefault;
     116   [ +  -  -  +  :          1 :   ASSERT_FALSE(withinValidInputRange(value));
          -  -  -  -  -  
                -  -  - ]
     117                 :            : }

Generated by: LCOV version 1.14