LCOV - code coverage report
Current view: top level - generated/include/ad/map/match - MapMatchedPositionTypeValidInputRange.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 10 10 100.0 %
Date: 2022-10-04 09:48:07 Functions: 1 1 100.0 %
Branches: 14 16 87.5 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2020 Intel Corporation
       5                 :            :  *
       6                 :            :  * SPDX-License-Identifier: MIT
       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/map/match/MapMatchedPositionType.hpp"
      23                 :            : #include "spdlog/fmt/ostr.h"
      24                 :            : #include "spdlog/spdlog.h"
      25                 :            : 
      26                 :            : /*!
      27                 :            :  * \brief check if the given MapMatchedPositionType is within valid input range
      28                 :            :  *
      29                 :            :  * \param[in] input the MapMatchedPositionType as an input value
      30                 :            :  * \param[in] logErrors enables error logging
      31                 :            :  *
      32                 :            :  * \returns \c true if MapMatchedPositionType 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                 :         25 : inline bool withinValidInputRange(::ad::map::match::MapMatchedPositionType const &input, bool const logErrors = true)
      37                 :            : {
      38                 :         50 :   bool inValidInputRange = (input == ::ad::map::match::MapMatchedPositionType::INVALID)
      39         [ +  + ]:          7 :     || (input == ::ad::map::match::MapMatchedPositionType::UNKNOWN)
      40         [ +  + ]:          6 :     || (input == ::ad::map::match::MapMatchedPositionType::LANE_IN)
      41         [ +  + ]:          5 :     || (input == ::ad::map::match::MapMatchedPositionType::LANE_LEFT)
      42   [ +  +  +  + ]:         32 :     || (input == ::ad::map::match::MapMatchedPositionType::LANE_RIGHT);
      43   [ +  +  +  - ]:         25 :   if (!inValidInputRange && logErrors)
      44                 :            :   {
      45         [ +  - ]:          3 :     spdlog::error("withinValidInputRange(::ad::map::match::MapMatchedPositionType)>> {}, raw value: {} ",
      46                 :            :                   input,
      47                 :          6 :                   static_cast<int32_t>(input)); // LCOV_EXCL_BR_LINE
      48                 :            :   }
      49                 :         25 :   return inValidInputRange;
      50                 :            : }

Generated by: LCOV version 1.14