LCOV - code coverage report
Current view: top level - generated/include/ad/map/access - PartitionIdValidInputRange.hpp (source / functions) Hit Total Coverage
Test: ad_map_access Lines: 5 8 62.5 %
Date: 2022-10-04 09:48:07 Functions: 1 1 100.0 %
Branches: 7 18 38.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: 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/access/PartitionId.hpp"
      23                 :            : #include "spdlog/fmt/ostr.h"
      24                 :            : #include "spdlog/spdlog.h"
      25                 :            : 
      26                 :            : /*!
      27                 :            :  * \brief check if the given PartitionId is within valid input range
      28                 :            :  *
      29                 :            :  * \param[in] input the PartitionId as an input value
      30                 :            :  * \param[in] logErrors enables error logging
      31                 :            :  *
      32                 :            :  * \returns \c true if PartitionId is considered to be within the specified input range
      33                 :            :  *
      34                 :            :  * \note the specified input range is defined by
      35                 :            :  *       std::numeric_limits<::ad::map::access::PartitionId>::lowest() <= \c input <=
      36                 :            :  * std::numeric_limits<::ad::map::access::PartitionId>::max()
      37                 :            :  */
      38                 :          2 : inline bool withinValidInputRange(::ad::map::access::PartitionId const &input, bool const logErrors = true)
      39                 :            : {
      40                 :            :   // check for generic numeric limits of the type
      41   [ +  -  +  -  :          4 :   bool inValidInputRange = input.isValid() && (std::numeric_limits<::ad::map::access::PartitionId>::lowest() <= input)
                   +  - ]
      42   [ +  -  +  -  :          4 :     && (input <= std::numeric_limits<::ad::map::access::PartitionId>::max());
                   +  - ]
      43   [ -  +  -  - ]:          2 :   if (!inValidInputRange && logErrors)
      44                 :            :   {
      45         [ #  # ]:          0 :     spdlog::error("withinValidInputRange(::ad::map::access::PartitionId)>> {} out of numerical limits [{}, {}]",
      46                 :            :                   input,
      47                 :          0 :                   std::numeric_limits<::ad::map::access::PartitionId>::lowest(),
      48                 :          0 :                   std::numeric_limits<::ad::map::access::PartitionId>::max()); // LCOV_EXCL_BR_LINE
      49                 :            :   }
      50                 :          2 :   return inValidInputRange;
      51                 :            : }

Generated by: LCOV version 1.14