LCOV - code coverage report
Current view: top level - generated/include/ad/rss/state - RssStateEvaluatorValidInputRange.hpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 16 16 100.0 %
Date: 2024-10-01 15:08:14 Functions: 1 1 100.0 %
Branches: 26 28 92.9 %

           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/rss/state/RssStateEvaluator.hpp"
      23                 :            : #include "spdlog/fmt/ostr.h"
      24                 :            : #include "spdlog/spdlog.h"
      25                 :            : 
      26                 :            : /*!
      27                 :            :  * \brief check if the given RssStateEvaluator is within valid input range
      28                 :            :  *
      29                 :            :  * \param[in] input the RssStateEvaluator as an input value
      30                 :            :  * \param[in] logErrors enables error logging
      31                 :            :  *
      32                 :            :  * \returns \c true if RssStateEvaluator is considered to be within the specified input range
      33                 :            :  *
      34                 :            :  * \note the specified input range is defined by the valid enum literals.
      35                 :            :  */
      36                 :      16754 : inline bool withinValidInputRange(::ad::rss::state::RssStateEvaluator const &input, bool const logErrors = true)
      37                 :            : {
      38                 :      33508 :   bool inValidInputRange = (input == ::ad::rss::state::RssStateEvaluator::None)
      39         [ +  + ]:      11170 :     || (input == ::ad::rss::state::RssStateEvaluator::LongitudinalDistanceOppositeDirectionEgoCorrectLane)
      40         [ +  + ]:      10435 :     || (input == ::ad::rss::state::RssStateEvaluator::LongitudinalDistanceOppositeDirection)
      41         [ +  + ]:      10117 :     || (input == ::ad::rss::state::RssStateEvaluator::LongitudinalDistanceSameDirectionEgoFront)
      42         [ +  + ]:       9489 :     || (input == ::ad::rss::state::RssStateEvaluator::LongitudinalDistanceSameDirectionOtherInFront)
      43         [ +  + ]:       7562 :     || (input == ::ad::rss::state::RssStateEvaluator::LateralDistance)
      44         [ +  + ]:        781 :     || (input == ::ad::rss::state::RssStateEvaluator::IntersectionOtherPriorityEgoAbleToStop)
      45         [ +  + ]:        458 :     || (input == ::ad::rss::state::RssStateEvaluator::IntersectionEgoPriorityOtherAbleToStop)
      46         [ +  + ]:        457 :     || (input == ::ad::rss::state::RssStateEvaluator::IntersectionEgoInFront)
      47         [ +  + ]:        456 :     || (input == ::ad::rss::state::RssStateEvaluator::IntersectionOtherInFront)
      48   [ +  +  +  + ]:      27924 :     || (input == ::ad::rss::state::RssStateEvaluator::IntersectionOverlap);
      49   [ +  +  +  - ]:      16754 :   if (!inValidInputRange && logErrors)
      50                 :            :   {
      51         [ +  - ]:          3 :     spdlog::error("withinValidInputRange(::ad::rss::state::RssStateEvaluator)>> {}, raw value: {} ",
      52                 :            :                   input,
      53                 :          6 :                   static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
      54                 :            :   }
      55                 :      16754 :   return inValidInputRange;
      56                 :            : }

Generated by: LCOV version 1.14