LCOV - code coverage report
Current view: top level - tests/generated/ad/rss/world - RoadSegmentTypeTests.cpp (source / functions) Hit Total Coverage
Test: ad_rss Lines: 27 27 100.0 %
Date: 2025-07-22 06:53:46 Functions: 9 9 100.0 %
Branches: 49 156 31.4 %

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
       3                 :            :  *
       4                 :            :  * Copyright (C) 2018-2022 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                 :            : #if defined(__clang__) && (__clang_major__ >= 7)
      16                 :            : #pragma GCC diagnostic push
      17                 :            : #pragma GCC diagnostic ignored "-Wself-assign-overloaded"
      18                 :            : #endif
      19                 :            : 
      20                 :            : #include <gtest/gtest.h>
      21                 :            : #include <limits>
      22                 :            : #include "ad/rss/world/RoadSegmentType.hpp"
      23                 :            : 
      24                 :          4 : TEST(RoadSegmentTypeTests, testFromString)
      25                 :            : {
      26   [ +  -  +  -  :          1 :   ASSERT_EQ(fromString<::ad::rss::world::RoadSegmentType>("Normal"), ::ad::rss::world::RoadSegmentType::Normal);
          +  -  -  +  -  
          -  -  -  -  -  
                   +  - ]
      27   [ +  -  +  -  :          1 :   ASSERT_EQ(fromString<::ad::rss::world::RoadSegmentType>("::ad::rss::world::RoadSegmentType::Normal"),
          +  -  -  +  -  
             -  -  -  -  
                      - ]
      28         [ +  - ]:          1 :             ::ad::rss::world::RoadSegmentType::Normal);
      29                 :            : 
      30   [ +  -  +  -  :          1 :   ASSERT_EQ(fromString<::ad::rss::world::RoadSegmentType>("Intersection"),
          +  -  -  +  -  
             -  -  -  -  
                      - ]
      31         [ +  - ]:          1 :             ::ad::rss::world::RoadSegmentType::Intersection);
      32   [ +  -  +  -  :          1 :   ASSERT_EQ(fromString<::ad::rss::world::RoadSegmentType>("::ad::rss::world::RoadSegmentType::Intersection"),
          +  -  -  +  -  
             -  -  -  -  
                      - ]
      33         [ +  - ]:          1 :             ::ad::rss::world::RoadSegmentType::Intersection);
      34                 :            : 
      35   [ +  -  +  -  :          3 :   EXPECT_ANY_THROW({ fromString<::ad::rss::world::RoadSegmentType>("NOT A VALID ENUM LITERAL"); });
          +  -  +  -  -  
          +  -  +  -  -  
                   -  - ]
      36                 :            : }
      37                 :            : 
      38                 :          4 : TEST(RoadSegmentTypeTests, testToString)
      39                 :            : {
      40                 :          1 :   int32_t minValue = std::numeric_limits<int32_t>::max();
      41                 :          1 :   int32_t maxValue = std::numeric_limits<int32_t>::min();
      42                 :            : 
      43   [ +  -  +  -  :          2 :   ASSERT_EQ(toString(::ad::rss::world::RoadSegmentType::Normal), "::ad::rss::world::RoadSegmentType::Normal");
          -  +  -  -  -  
             -  -  -  +  
                      - ]
      44                 :          1 :   minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::world::RoadSegmentType::Normal));
      45                 :          1 :   maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::world::RoadSegmentType::Normal));
      46                 :            : 
      47   [ +  -  +  -  :          2 :   ASSERT_EQ(toString(::ad::rss::world::RoadSegmentType::Intersection),
          -  +  -  -  -  
                -  -  - ]
      48         [ +  - ]:          1 :             "::ad::rss::world::RoadSegmentType::Intersection");
      49                 :          1 :   minValue = std::min(minValue, static_cast<int32_t>(::ad::rss::world::RoadSegmentType::Intersection));
      50                 :          1 :   maxValue = std::max(maxValue, static_cast<int32_t>(::ad::rss::world::RoadSegmentType::Intersection));
      51                 :            : 
      52   [ +  -  +  -  :          2 :   ASSERT_EQ(toString(static_cast<::ad::rss::world::RoadSegmentType>(minValue - 1)), "UNKNOWN ENUM VALUE");
          -  +  -  -  -  
             -  -  -  +  
                      - ]
      53   [ +  -  +  -  :          2 :   ASSERT_EQ(toString(static_cast<::ad::rss::world::RoadSegmentType>(maxValue + 1)), "UNKNOWN ENUM VALUE");
          -  +  -  -  -  
             -  -  -  +  
                      - ]
      54                 :            : }
      55                 :            : 
      56                 :          4 : TEST(RoadSegmentTypeTests, ostreamOperatorTest)
      57                 :            : {
      58         [ +  - ]:          1 :   std::stringstream stream;
      59                 :          1 :   ::ad::rss::world::RoadSegmentType value(::ad::rss::world::RoadSegmentType::Normal);
      60         [ +  - ]:          1 :   stream << value;
      61   [ +  -  +  -  :          1 :   ASSERT_GT(stream.str().size(), 0u);
          -  +  -  -  -  
             -  -  -  +  
                      - ]
      62         [ +  - ]:          1 : }
      63                 :            : 
      64                 :            : #if defined(__clang__) && (__clang_major__ >= 7)
      65                 :            : #pragma GCC diagnostic pop
      66                 :            : #endif

Generated by: LCOV version 1.14