LCOV - code coverage report
Current view: top level - generated/include/ad/rss/world - LateralRssAccelerationValuesValidInputRange.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 20 20 100.0 %
Date: 2024-04-30 13:12:49 Functions: 1 1 100.0 %
Branches: 30 42 71.4 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2020 Intel Corporation
       5                 :            :  *
       6                 :            :  * SPDX-License-Identifier: LGPL-2.1-only
       7                 :            :  *
       8                 :            :  * ----------------- END LICENSE BLOCK -----------------------------------
       9                 :            :  */
      10                 :            : 
      11                 :            : /**
      12                 :            :  * Generated file
      13                 :            :  * @file
      14                 :            :  *
      15                 :            :  * Generator Version : 11.0.0-1997
      16                 :            :  */
      17                 :            : 
      18                 :            : #pragma once
      19                 :            : 
      20                 :            : #include <cmath>
      21                 :            : #include <limits>
      22                 :            : #include "ad/physics/AccelerationValidInputRange.hpp"
      23                 :            : #include "ad/rss/world/LateralRssAccelerationValues.hpp"
      24                 :            : #include "spdlog/fmt/ostr.h"
      25                 :            : #include "spdlog/spdlog.h"
      26                 :            : 
      27                 :            : /*!
      28                 :            :  * \brief check if the given LateralRssAccelerationValues is within valid input range
      29                 :            :  *
      30                 :            :  * \param[in] input the LateralRssAccelerationValues as an input value
      31                 :            :  * \param[in] logErrors enables error logging
      32                 :            :  *
      33                 :            :  * \returns \c true if LateralRssAccelerationValues is considered to be within the specified input range
      34                 :            :  *
      35                 :            :  * \note the specified input range is defined by the ranges of all members, plus:
      36                 :            :  *       ::ad::physics::Acceleration(0.) <= accelMax <= ::ad::physics::Acceleration(1e2)
      37                 :            :  *       ::ad::physics::Acceleration(-1e2) <= brakeMin < ::ad::physics::Acceleration(0.)
      38                 :            :  */
      39                 :     272916 : inline bool withinValidInputRange(::ad::rss::world::LateralRssAccelerationValues const &input,
      40                 :            :                                   bool const logErrors = true)
      41                 :            : {
      42                 :            :   // check for generic member input ranges
      43                 :     272916 :   bool inValidInputRange = true;
      44                 :            :   inValidInputRange
      45   [ +  +  +  + ]:     272916 :     = withinValidInputRange(input.accelMax, logErrors) && withinValidInputRange(input.brakeMin, logErrors);
      46   [ +  +  +  - ]:     272916 :   if (!inValidInputRange && logErrors)
      47                 :            :   {
      48         [ +  - ]:         10 :     spdlog::error("withinValidInputRange(::ad::rss::world::LateralRssAccelerationValues)>> {} has invalid member",
      49                 :            :                   input); // LCOV_EXCL_BR_LINE
      50                 :            :   }
      51                 :            : 
      52                 :            :   // check for individual input ranges
      53         [ +  + ]:     272916 :   if (inValidInputRange)
      54                 :            :   {
      55                 :            :     inValidInputRange
      56   [ +  -  +  +  :     272906 :       = (::ad::physics::Acceleration(0.) <= input.accelMax) && (input.accelMax <= ::ad::physics::Acceleration(1e2));
             +  -  +  - ]
      57   [ +  +  +  - ]:     272906 :     if (!inValidInputRange && logErrors)
      58                 :            :     {
      59         [ +  - ]:       1003 :       spdlog::error("withinValidInputRange(::ad::rss::world::LateralRssAccelerationValues)>> {} element {} out of "
      60                 :            :                     "valid input range [{}, {}]",
      61                 :            :                     input,
      62                 :       1003 :                     input.accelMax,
      63                 :       1003 :                     ::ad::physics::Acceleration(0.),
      64                 :       2006 :                     ::ad::physics::Acceleration(1e2)); // LCOV_EXCL_BR_LINE
      65                 :            :     }
      66                 :            :   }
      67                 :            : 
      68         [ +  + ]:     272916 :   if (inValidInputRange)
      69                 :            :   {
      70                 :            :     inValidInputRange
      71   [ +  -  +  -  :     271903 :       = (::ad::physics::Acceleration(-1e2) <= input.brakeMin) && (input.brakeMin < ::ad::physics::Acceleration(0.));
             +  -  +  + ]
      72   [ +  +  +  - ]:     271903 :     if (!inValidInputRange && logErrors)
      73                 :            :     {
      74         [ +  - ]:       2002 :       spdlog::error("withinValidInputRange(::ad::rss::world::LateralRssAccelerationValues)>> {} element {} out of "
      75                 :            :                     "valid input range [{}, {}]",
      76                 :            :                     input,
      77                 :       2002 :                     input.brakeMin,
      78                 :       2002 :                     ::ad::physics::Acceleration(-1e2),
      79                 :       4004 :                     ::ad::physics::Acceleration(0.)); // LCOV_EXCL_BR_LINE
      80                 :            :     }
      81                 :            :   }
      82                 :            : 
      83                 :     272916 :   return inValidInputRange;
      84                 :            : }

Generated by: LCOV version 1.14